Jumpy animation
sparx13
Member Posts: 97
HI!
I'm in the process of making a game and in the game I've got two actors with an animation that makes it look like they are walking, an attacking animation and a die animation. I've also got a rule so when health is below 1 play the die animation or what ever and then destroy the actor. But when I play it all the animations go well until one of them goes to die, it is really glitchy, the character basically falls over but its glitchy.
I've got a error as well that all of the actors when they spawn if the same actor that has spawned before it has died it will spawn and die as well, when they die away from the enemy actor it dies smoothly(the animation is smooth)
I don't know how to fix this?
I'm in the process of making a game and in the game I've got two actors with an animation that makes it look like they are walking, an attacking animation and a die animation. I've also got a rule so when health is below 1 play the die animation or what ever and then destroy the actor. But when I play it all the animations go well until one of them goes to die, it is really glitchy, the character basically falls over but its glitchy.
I've got a error as well that all of the actors when they spawn if the same actor that has spawned before it has died it will spawn and die as well, when they die away from the enemy actor it dies smoothly(the animation is smooth)
I don't know how to fix this?
Best Answer
-
SolarPepperStudios Posts: 754Here is what I would do for a health bar, I would make 4 (or however many lives you have) sprites for the health bar, each one lower than the last. Every time you character gets hurt and it changes the life attribute I would change the health bar's image. Make sure that the health bar is a global attribute though or it won't work. If you don't like that idea or it does't work then see if @tshirtbooth has a video on it.
Answers
can you provide some code or? The error that all spawned die also sounds like that the attribute doesn't get set back, I also wouldn't use spawn since it needs memory usage.
Is the health attribute an game attribute or an attribute in the actor itself?
Alex
Thanks in advance!
Make one in the actor called "life".
When self.life <1
destroy or what you want to have.
This way when you spawn a new actor, the self.life will be always the value you set. Now you have 1 attribute for all actors spawned. Now each one has it's own
Let me know,
Alex
Help would be awesome thanks!
Thanks in advance!