- Home /
When triggered in Timeline, Animations that modify a property on a GameObject will have that property reset by a second Animation that does not modify that property. How do you avoid this?
In Unity 2018.3.0b12, 2018.3.0b3 (others untested)
When triggered in Timeline, Animations that modify a property on a GameObject (e.g., Transform.localposition), will have that property reset by a second Animation that does not modify that property (e.g., Transform.localscale).
Is this intended behaviour? Perhaps I am misunderstanding how this should work? How do you avoid this?
I attach an example project: With a Sphere that moves left 5 units and then scales up *5.
With the timeline PlayOnAwake disabled: the Animator correctly animates through the steps.
With the timeline PlayOnAwake enabled: The Timeline Fires each animation independently overriding the offset created by the first animation.
From a conversation on Unity Beta Forums:
I've added tried adding position and/or Rotation $$anonymous$$eyframes to the Animation Clip, but these don't fix the problem.
I've dug further and found that I can get the in game to play correctly by setting the Track Offsets on the Timeline->AnimationTrack to Apply Scene Offsets. However, when playing this in the Timeline in editor mode the animation plays incorrectly as I first described. Naturally this will make development within timeline cumbersome, as we will have to play the scene every time we want to check an edit.
Answer by seant_unity · Dec 12, 2018 at 04:10 PM
This is intended behaviour, but it is a bit specific to root transforms. A timeline track either does modify root transform, or does not. That is determined by if any clips modify root transforms. If only one clip does not modify rotation, for example, then the default value is written. It is done this way to support the ability to offset the entire track.
Your answer
Follow this Question
Related Questions
Timeline send objects to zero position in play mode. 4 Answers
2D Animation does not start 1 Answer
Player Starting In Different Positions When Timeline Ends 1 Answer
How to create animations that can be edited with scripts in runtime? 1 Answer
Damn, HOW CAN I KNOW, IF MY 2d ANIMATION SPRITE IS FINISHED??!! 0 Answers