Search Unity

GameObject scale set to 1 when timeline plays in play-mode

Discussion in 'Timeline' started by themeshpotato, May 6, 2019.

  1. themeshpotato

    themeshpotato

    Joined:
    Apr 11, 2018
    Posts:
    55
    I've added a simple animation clip to my timeline that does a sprite animation.
    The object has a Animator and with an animation controller and if I play the timeline in edit-mode the cutscene works perfectly, but if I run it in play-mode all sorts of weird stuff happens like the scale of the object getting set to 1 instead of 0.5. This behaviour disappears when I remove the animation controller from the object.

    But my question is: is this expected behaviour? And is there a way to have an animation controller AND still keep the exact transform in play-mode?
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    In edit mode, the controller isn't run, but in playmode it is run before timeline, and timeline blends onto it. If the problem is the controller is setting certain properties that timeline isn't animating, you may need to add an override track and explicitly key those properties.
     
  3. themeshpotato

    themeshpotato

    Joined:
    Apr 11, 2018
    Posts:
    55
    Okay, I didn't think that the animation controller actually changed any properties that are not part of the animation it is playing? Since none of the animation clips are actually changing the scale. But I might have misunderstood how the controller works.

    I'll look into the override track, thanks for the suggestion!
     
  4. themeshpotato

    themeshpotato

    Joined:
    Apr 11, 2018
    Posts:
    55
    @seant_unity where does the scale change come from, if the animation clips don't scale the object and nothing in the timeline actually sets the scale?
    It can't be expected behaviour that the scale of an object is reset just by having an animation controller?

    Is it possible that I might have overlooked somewhere, where the scale is actually set to 1?
     
  5. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    That's a bit strange if both the controller and timeline aren't playing animation clips that change scale. If the objects scene value (outside of timeline, in edit mode) is actually 0.5, then it's possible something (controller, timeline) is overwriting it, but I can't think of what that could be. Or the default values are getting overwritten somewhere (more likely in the controller, since timeline doesn't have the option to write default values).

    Sorry, I'm a bit stumped. I wish I could be of more help.
     
  6. themeshpotato

    themeshpotato

    Joined:
    Apr 11, 2018
    Posts:
    55
    I'm not sure what is causing it, but I'm doing a workaround right now and that's fine for now.
    I'll let you know if I actually find the cause.
     
  7. AAManiqueH

    AAManiqueH

    Joined:
    Apr 29, 2020
    Posts:
    3
    This happens to me also, the timeline makes the gameobject scale to 1
     
    jaredrwight likes this.
  8. jaredrwight

    jaredrwight

    Joined:
    Nov 7, 2020
    Posts:
    1
    I am also having this issue! Did any of you find a fix?

    Edit: Never mind. There seems to be a weird glitch where my scaled parent obj was reverting to 1 on play. I fixed it by unparenting.
     
    Last edited: Jan 1, 2022