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

Open
#5,939 1 comment 0 reactions 1 assignee View on GitHub

@kpal81xd is already working on this.

Since Jan 10, 2024.

area: animation
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
  1. Create a simple animation state graph of two animations, each that transitions to the other on the exit time condition
  2. Set the speed of those nodes to a value > 1
  3. Observe that the animations cut off early rather than playing a full cycle.
  4. Switch the exit time value from 1 to the value you speed scaled by
  5. Observe that this now works.
Screenshot 2024-01-10 at 10 56 04

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.