playcanvas / playcanvas/engine
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
@kpal81xd is already working on this.
Since Jan 10, 2024.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.