Empty Animator Controller completely freezes position and rotation after Timeline finishes (very basic cutscene setup: control is not returned to the player)
I was trying to make a basic intro cutscene using Timeline in which character moves from left to right (and other irrelevant things happen). After the cutscene the control is supposed to return to the player. The problem is it doesn't. Even trying to move the character in the editor doesn't work. Returning control to the player after the cutscene seems like a very basic thing but after spending several hours of trying and googling I wasn't able to find a solution.
I was able to reproduce minimum example of the problem:
https://drive.google.com/file/d/1FRsYHgvZEmVrQ519cTRsVwl8b7Ecx0Ky/view?usp=sharing
Open the scene and press play.
Two circles move from left to right. After the timeline finishes playing green circle stays inplace (as expected) and you are able to freely move it in the editor (as expected). Red circle on the other hand magically teleports to the initial position and is now completely blocked: trying to change it's position and rotation in editor has no effect.
Both circles have "Animator" component attached to them and are completely equivalent in other ways. The only difference is that the red circle has the empty (created using Right Click -> Create Animator Controller) animator controller set in it's Animator-Component while Green circles Animator-Component controller is set to None (default value).
Is this a bug?
In the real world setup I need the player (which is animated) to have an Animator Controller to animate it through the game.
Unity 2018.3.0f2, MacOS
Answer by seant_unity · Dec 14, 2018 at 02:51 PM
It may be a bug, but only when returning to an empty controller. It appears that the controller is writing default values every frame after the timeline finishes, which is why it's 'locked'. When returning to a controller with animation states it behaves as expected (i.e. the controllers animation plays).
Just checked:
1) Opened Animator Controller
2) Created a new empty state
3) Created transition from Entry to "New State"
4) In "New State" Inspector tried both checking and unchecking "Write Defaults" option.
Nothing changed in the way game played: red circle still teleports and is still blocked.
Yes, but it's an empty state. Add an animation and that animation will play. Write defaults says the current pose will become the new default pose. The problem is the controller is updating the current pose to what ever the default is. Timeline does not write default poses, and since the controller never changes the pose, the default never changes - that's why Write Defaults has no affect. It may very well be a bug that going back to the empty controller (or empty state) writes any pose at all - I'm not sure what the intended behaviour there is.
https://drive.google.com/file/d/1kgASBeQ8DcLF94TN06ScBt3nEpmmS1pA/view?usp=sharing
I created two animations for "New State" of Red Circle
1) Scale animation ("A Scale.anim"). Red circle all the time (during and after timeline) scales up and down (as expected). This didn't affect red circle's position (as expected) which still teleports back (as unwanted).
2) Position animation ("A Wiggle.anim"). Red circle moves according to the timeline (as expected) and plays it's position animation afterwards (as expected for this setup but not the desired effect).
Your answer
Follow this Question
Related Questions
Timeline and morphing done in 3D max and other programs, Help! 0 Answers
Animation and Timeline Not Working,Animation and timeline errors 0 Answers
How do I change text in timeline animation? 1 Answer
Animator doesn't work on prefab after loading from Asset Bundle 1 Answer
How do I puse an animation? 1 Answer