Closed giusdp closed 1 year ago
So, OnAnimationEnd is supposed to be for when the animation ends, and since a looping animation doesn't end, it's not called.
OnAnimationLoop was the correct call since it's called on the frame the animation loops back to the first frame.
In hindsight I can see how this would be confusing and definitely may need a change or better documentation.
As for one time animations that play and dont loop, check this out. If you end a tag name in Aseprite with [oneshot]
, then the processor will detect this and only play the animation once. So like if your animation is a door opening and the tag is called open_door
, then rename the tag to open_door[oneshot]
, and it will only play once when called without looping. Note that to play it you still just call .Play("open_door")
, the oneshot part is removed from the name.
Just checked and the [oneshot]
trick isn't in the documentation page at all, so I def need to update that
The [oneshot] trick is really neat. I will use that surely! Thanks
Closing this issue, tracking will now be done in issue #43
Hello, I'm probably having an uncommon use case in my hands. I have an aseprite document with a single animation of 5 frames that I want it to run just once. I thought about doing this:
but the animation loops anyway. I later found out the Pause method, but again it loops anyway with that too.
EDIT: I tried OnAnimationLoop and it worked. I thought that OnAnimationEnd would fire after the last frame, my bad.