Search Unity

Animator speed is not 1

Discussion in 'Animation' started by MrMatthias, Feb 14, 2019.

  1. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    191
    What could cause the animator speed to not be equal to 1?
    I have states with individual speeds and a speed multiplier, but i don't set the animator.speed property.

    does animator.speed represent state.speed * state multiplier speed and this is a lack of precision?

    in another scene i get this though:
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    The docs say Animator.speed is another multiplier on top of state speed and the state speed multiplier. It can't be getting the speed from the current state because there can be multiple states active at the same time during transitions and on different layers. And even if it did, 0.88... is way too far off for a simple lack of precision.

    I have no idea why it wouldn't always be 1 unless you change it. Are you absolutely sure none of your scripts are setting the speed? If so, you might need to backup your project (which you should be doing anyway) and strip parts out of it until you can narrow down the cause. Then report a bug if it seems like one.
     
  3. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    191
    yeah, unless the values get clamped. but yeah that doesn't seem to be the case

    The bug was noticed some time after upgrading unity, i'm not sure whether that's the cause, but the app is visualizing realtime data and it probably would have been noticed earlier; release was 2015.
    I used to set the Animator.speed by script, but something was overwriting that value. Removing all code and instead using state speed and multiplier didn't fix it.
    The project is in version control, so i'll try to isolate the problem.
     
  4. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Crazy thought, but have you checked if the Animator.speed is actually serialized? It shouldn't be because it's not shown in the inspector, but that could easily cause this issue if it is.