Search Issue Tracker

By Design

Votes

5

Found in

2017.4

2019.3.7f1

2020.2

Issue ID

1232230

Regression

No

Animator State freezes when using a negative Speed Multiplier to play an Animation in reverse

Animation

-

How to reproduce:
1. Open the attached project (case-1232230.zip)
2. Open the Scene 'flyingScene'
3. Make sure the Animator window is open (Window -> Animation -> Animator)
4. In the Hierarchy window, select RPG-Character GameObject
5. Make sure that the Animator 'AnimationSpeed' parameter is set to -1
6. Enter the Play Mode
7. Select the 'Unarmed - Jump - Flip' State and set the Speed Multiplier to true
8. Exit and reenter Play Mode
9. Click the Jump Flip button

Expected result: the 'Unarmed - Jump - Flip' is entered and the character does a backflip (the animation is reversed)
Actual result: the 'Unarmed - Jump - Flip' state is entered and it almost immediately freezes

Reproducible with: 2017.4.39f1, 2018.4.20f1, 2019.3.7f1, 2020.1.0b4, 2020.2.0a7

Notes:
1. Animator float parameter 'AnimationSpeed' which Is set to -1.0 acts as a Speed Multiplier to play the Animation backward. Disabling it and setting the 'Unarmed - Jump - Flip' State Speed to -1 instead of 1 resolves the issue
2. The issue occurs with any negative Speed Multiplier values
3. The same issue reproduces in the project that the user attached but it couldn't be tested on all of the necessary versions

  1. Resolution Note (2021.1.X):

    After internal discussion, this is by design. There is two types of speed. The state speed, and parameter speed. When setting a state speed, a binding is redone which then checks if the speed is negative or not. If it is negative, it will detect that it has to start from the end.

    A parameter speed, on the other hand, doesn't create a rebind. If the state speed is positive, which tells the state to play from beginning to end, and the parameter speed is negative, then what will happen is that the animation time will go into the negative for a non looping clip. This is expected behavior, as some projects actually want this (for example, to add delay before starting an animation. A user might start with a negative parameter speed, then set it positive after x seconds ). Changing the behavior to fit what the user wants would break many projects that actually relied on this working as it is.

    - A workaround could be to either have two states (one with positive and negative state speed) instead of just one.
    - Another workaround could be to use cycle offset. This requires the clip to be looping, but one could decide to start the animation from the end of the clip, and create a trigger to transition out of the state once the clip made a complete loop

Comments (2)

  1. CyberRobin

    Nov 19, 2020 12:56

    "Fix In Review for 2021.1" seriously? You are going to leave people with versions all the way to 2017 with a broken animator????????

    I mean workarounds exist I suppose but this isn't the only problem with the animator, and I think they are linked to the same bug, when was the last time it was updated? Hello? Isn't animation like a huge part of every game???? This should be prioritized to be fixed in every version, period.

  2. ThirtysixLab

    Oct 06, 2020 14:46

    Just type the following:

    animator.StartPlayback ();
    animator.speed = -1f;

    It works for me!!!

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.