wilmer
Member
Cheers :
I have this need, I have a character that flies and an enemy that tries to knock him down with his abilities, when my flying character falls, he will be on the ground for a few seconds until he can take flight again, and a variable called "Down" is activated. "that changes from false to true. The idea is that with another variable called "Change_anim" a random integer is chosen, so that the enemy has to choose between 2 attack animations when my character falls. The problem is that I try to do it from a Step Event when the "Down" variable is activated but with this it does not work for me because the Step Event will change the variable with each frame in the game.
How do I make the "Changeanim" variable stay at a single number until "Down" is false again.
I have this need, I have a character that flies and an enemy that tries to knock him down with his abilities, when my flying character falls, he will be on the ground for a few seconds until he can take flight again, and a variable called "Down" is activated. "that changes from false to true. The idea is that with another variable called "Change_anim" a random integer is chosen, so that the enemy has to choose between 2 attack animations when my character falls. The problem is that I try to do it from a Step Event when the "Down" variable is activated but with this it does not work for me because the Step Event will change the variable with each frame in the game.
GML:
if flying_character.Down == true
{
randomize ()
Change_anim = choose (1,2)
// I use Spine, but it is almost the same as using sprite_index
if Change_anim == 1 {
if skeleton_animation_get ()! = "Attack1" {
skeleton_animation_set ("Attack1")}
}
if Change_anim == 2 {
if skeleton_animation_get ()! = "Attack2" {
skeleton_animation_set ("Attack2")}
}