Why my behaviour shows only the first frame of animation?

PonyStew

  • Posts: 17
http://imgur.com/a/RYdcz

Uh, so, it looks like i have a problem. While this behaviour works, it works half way, since it shows only the first frame of requested animation. Anyone knows why?

« Last Edit: December 10, 2016, 02:30:35 am by PonyStew »

oripessach

  • *
  • Posts: 259
Repeatedly changing an actor's animation to the same animation will reset it to the first frame.

I worked around this by creating a block to change the animation that accepts the animation name as an argument, and checks whether the actor's current animation is different from the requested animation. If they're different, it sets the animation to the requested animation, otherwise it leaves it alone.

I used that block instead of the "switch animation" block.

Otherwise, you'll need to manage your actor's state more carefully and switch animations only on state transitions.

BMJ

  • Posts: 278
Repeatedly changing an actor's animation to the same animation will reset it to the first frame.

This is only true for animations that do not loop. A looping animation will ignore a command to switch if it is already playing that animation.

PonyStew

  • Posts: 17
Repeatedly changing an actor's animation to the same animation will reset it to the first frame.

This is only true for animations that do not loop. A looping animation will ignore a command to switch if it is already playing that animation.
Unforunately, that's my case.

PonyStew

  • Posts: 17
Repeatedly changing an actor's animation to the same animation will reset it to the first frame.

I worked around this by creating a block to change the animation that accepts the animation name as an argument, and checks whether the actor's current animation is different from the requested animation. If they're different, it sets the animation to the requested animation, otherwise it leaves it alone.

I used that block instead of the "switch animation" block.

Otherwise, you'll need to manage your actor's state more carefully and switch animations only on state transitions.


Could you, maybe, share an example of that block?