Search Unity

Bug Animation Delay After Transitioning To Mirrored Animation With Negative Speed

Discussion in 'Animation' started by WidmerNoel, Apr 17, 2023.

  1. WidmerNoel

    WidmerNoel

    Joined:
    Jun 3, 2014
    Posts:
    66
    My animation controller has an animation state for "WalkRight". I copied that state and checked "Mirror" on the copy in order to get a "Walk Left" state. This works perfectly fine.

    My game has a rewind mechanic. When the game rewinds the animations should play in reverse. To achieve that I am setting an animator parameter called "TimeScale" to a negative value at runtime. All my animation states use this "TimeScale" as their speed multiplier.

    Problem: Every transition that transitions to "Walk Left" causes the animation to freeze and play after about 1 second. During that delay my character uses some weird pose that might be the result of the transition blend. I can only reproduce this with a negative speed multiplier and a mirrored animation. The Animator shows the animation as "playing" (indicated by the blue bar at the bottom of the state) but nothing is playing. When the state reaches about half progress then the animation actually starts playing in reverse.

    Does anyone know what I could be doing wrong or knows if this is a known issue?
    • None of my animation states use exit time.
    • I do use transition duration. But since the transition duration works flawlessly with a positive speed multiplier I wouldn't know why it should break with a negative speed multiplier.
     
  2. Desertleaf

    Desertleaf

    Joined:
    Dec 15, 2013
    Posts:
    15
    Sorry that no one responded to you about this; unfortunately I do not have a solution to your problem but wanted to share that I too am having a similar case.

    The animator doesn't seem to work with negative numbers as a speed multiplier (parameter). This doesn't make any sense because reverse animation work perfectly when using a negative value on individual Animator States -- works perfectly.
     
  3. WidmerNoel

    WidmerNoel

    Joined:
    Jun 3, 2014
    Posts:
    66
    @Desertleaf I think I solved this back then by using two different animation states instead of using the mirror setting. It's annoying because it doubles my animation states. I still believe it is a bug.

    But I am not reporting bugs anymore otherwise I would need to report every other api call there is in the engine. And they don't seem to care enough to fix anything.