In my example the object never reaches the blue color even changing the duration of the frames to an even higher value. In my opinion the animation should only be considered as finished when the duration of the last frame is over.
Is that a bug? Or is my code missing something?
hi, I have a few weeks using the engine, im liking it so far, when that happens to me I usually repeat the last frame of the animation twice and seems to work :]
The frame isn’t skipped, however computers are faster than humans, so as soon as it hits the last frame it is finished, and since you’re changing to a new animation immediately, this is happening:
The animation hits the last frame, so there are no more frames to go to.
The animation is finished as far as the engine is concerned.
Your events immediately makes it switch to the next animation.
Also, whenever dealing with animation changes, ensure you always use trigger once as a condition for your event. There can be conflicts between animations that are looking for the same conditions if you don’t include it.
I know the computers can be faster than humans, but the point is: shouldn’t the “animation finished” condition take into account the frame’s duration time rather than accepting that it was terminated only because it was loaded by engine?
And thanks for all the answers! I already use 2 frames for the last frame to avoid this, but I thought there was something wrong with the way it was working. I don’t think anyone expects the last frame not to be presented in this situation. On the other hand, I also understand that this is not something very important to worry about, as it is not difficult to solve.
To add clarity, the engine is doing what is described in the documentation and engine itself, so it doesn’t look like there’s any mechanical bug to fix.
When you’re previewing an animation it shows the animation speed in frames per second, which is just a translation of what it is showing outside of the preview (Not dealing with specific frames, but how long it takes between frames). Outside of the preview, this is shown as time elapsed between two frames, not animation duration.
Currently, there isn’t anything in the engine that goes based off a set duration of an animation, just the framerate. From some quick searches this is how a lot of engines deal with animation speeds, in that you’re setting duration between frames, not a preset amount of time to display an animation.
If you’re wanting to render the final frame longer with the event in the opening post, either add another copy of the final frame, as others have mentioned, or you could have the event trigger a timer, then only swap animations after the timer has finished.