engine
engine copied to clipboard
If a node in an Animation State Graph has a speed other than 1 the Exit Time condition of transitions from that node behaves incorrectly
Description
Sometimes we need to have a node in an Animation State Graph play at a speed different from 1. We also want that node to transition once the animation has played once. If we set the Exit Time condition to 1 (which the documentation tells us is normalised so that 1 is 100% of the animation) then we find that the node does not actually transition at that point.
Demonstration Project: https://playcanvas.com/project/1179681/overview/animation-node-speed-scale-bug
In this demo project the character on the right has a graph set to play two sword swings, each is played at double speed and set to transition to the other on an exit time of 1. You can see that this breaks (the animations are cut off half way, as if the exit time condition is not factoring in the change of speed).
The character on the left is the same, but the transitions have an exit time that matches the speed scale, the animations now play once, despite having an exit time that implies they should play twice.
Steps to Reproduce
- Create a simple animation state graph of two animations, each that transitions to the other on the exit time condition
- Set the speed of those nodes to a value > 1
- Observe that the animations cut off early rather than playing a full cycle.
- Switch the exit time value from 1 to the value you speed scaled by
- Observe that this now works.
possibly related: https://forum.playcanvas.com/t/model-animation-stuck-when-using-trigger/35681