Problem Description
On Animation Finished trigger fires while last frame plays instead of when it finishes.
Attach a Capx
http://www.silvite.com/crap/AnimationExample.capx
Description of Capx
This project is a simplified version of a concept I'm using for climbing ladders or vaulting over walls in my game, simplified to two events. When the movement is triggered (in this case by pressing Space) the game triggers the animation "Move". The second line is "On Animation "Move" Finished" which then moves the sprite to the position that the animation ended up, in the game that would be wherever the character climbed to. However, the event seems to be triggering -while- the last frame plays and causes animations to flicker between states.
Steps to Reproduce Bug
- Step 1: Trigger an animation "Example"
- Step 2: Create a "On Animation "Example" Finished" trigger that moves the sprite.
Observed Result
The sprite moves into the new location before the animation finishes and causes the sprite to appear in the wrong location until it sets the animation to default.
Expected Result
The "Move" animation would play in its entirety before triggering the event, resulting in a sprite that appears to have seamlessly moved.
Alternate Repro
- Step 1: Create a sprite with two animations, "Green" and "Red".
- Step 2: Create event: On keypress: set sprite animation to "Red" and set sprite invisible.
- Step 3: Create event: On animation "Red" finished: set sprite animation to "Green" and set sprite visible.
Observed Result
The sprite will remain green, pressing control will make the object invisible but then it will flicker red for a frame after becoming visible and before turning green again.
Expected Result
The sprite would only show green, the red frames would never be visible.
Affected Browsers
- Chrome: YES
- FireFox: Untested
- Internet Explorer: YES
Operating System and Service Pack
Windows 7 Home Premium SP1
Construct 2 Version ID
r212.2
This alternate example has less practical use but is an easier example to show the events playing before the animation has finished.
I've tried working around this by ending my animation with a blank frame but this just causes the character to flash invisible.