I’m not sure if I’m missing something here, but it seems that if you have a custom animator controller on a gameobject, put that gameobject into a timeline and attempt to move its position using the timeline; the object will be unmovable once the timeline completes.
I’ve tested this with a brand new project, using a gameobject that only has a sprite renderer an animator and a custom anim controller that only consists of a single sprite. I test if the object can move by attempting to change its transform position in the scene after the timeline completes.
If I disable and re-enable the “Animator” component, the object will be movable again. Also if I clear the “Animator->Controller” field for “None (Runtime Animator Controller)” this issue does not occur
Does anyone know why this would be happening? It’s a big issue for me since I want to move my playable characters position in a timeline, and continue controlling it after the cinematic.
Sure, I’ll post a clip when I’m back at my computer tonight.
For now when I say unmoveable, I mean it resets its position if you try to move it. For instance, if you click on the game object in the editor, type in a new X value to the transform.position and press enter; it will immediately reset the position to where it was.
If I enable / disable my animator at this point and try the same test, then the gameobject will properly move to my defined value
Here’s a clip of what I’m seeing. The square is being moved from left to right using a timeline. Once the timeline has finished. I cannot change the squares position unless i disable and re-enable the animator
Interesting, I wasn’t able to repro here unfortunately, if you can open a bug with the attached project and post the bugid here, I will be able to track it down
I created a bug report for this and uploaded the project twice today. Each time I got a notification saying that “It was successfully uploaded and should receive an email shortly”. However after waiting all day, I haven’t gotten an email from either attempt.
Hi, I’m also experiencing this bug but can’t find it in the issue tracker. It’s like the animation clip that I have on my timeline doesn’t clear it’s bindings properly and therefore is constantly setting the game objects position.
I tested in a similar scene to Greg and can recreate this. Not sure if this is the same as Greg’s issue but if you:
-Add cube to scene,
-create playdirector and animator using the button in timeline,
-Add animation track, assign cube and add a couple of movement keyframes.
-Play anim, cube moves and when finished cube can be moved - this all works fine.
To break it:-
-Add a separate animator controller and assign it to the cube’s controller
-Play anim and when finished cube cannot be moved
So I think it’s to do with having 2 different animatorcontrollers. We ended up caching the runtimeanimatorcontroller and setting it to null. Then in the animator stopped callback we reassign it to the cached controller and all seems to be back to normal. Hope that helps.
Thanks for the reply dandawes, that’s the exact issue i’m seeing. If the animator controller is empty, this issue does not occur. If I have an animator controller assigned, then the gameobject cannot be moved after the timeline sequence completes.
Caching and re-assigning the controller is what crossed my mind for fixing this too, but it sounds like a work around to a bug in the timeline feature.
I’ve been emailing back and forth with unity’s bug team in attempt for them to see why this is bad… but so far no luck. The issue id I opened is 1118708, but apparently it can’t go public until their QA team acknowledges it as an issue
Just to re-iterate what the issue is here:
A timeline that is no longer playing should not override the position of a gameobject that is using an animator controller.
Thanks for the updates on this. I’ve been following up on this with the animation team, and I’ve followed up with QA, and the issue filed by @Gregwar should be officially opened up as bug very soon.
Resetting the animator controller is a good workaround for now. We’ve been incorrectly assuming this bug was a change in behaviour between 2018.2 and 2018.3 where animator & timeline underwent a lot of animation changes with regard to root transforms. Turns out, the bug exists in 2018.2.
It appears that once the animator starts writing the root transform (on behalf of timeline), then the state machine continues to always write the root transform even when the state has no root transform animation. Resetting the state machine, as @dandawes pointed out seems to fix it.
So unless you we use root motion , timeline will keep affecting the position of the object? Is there anyway of fixing it for non root motion? my character dynamically switches from gameplay to cutscene and from cutscene to gameplay. but when ever i disable root motion for technical purposes(air brake) my character teleports to the cutscene’s origin position. I tried disabling and enabling animator but that only works if i manually do it and not via script. What do you suggest i do?
In short, yes. If any of the animations played by timeline modify the root transform, then timeline will write the root position and rotation. Whether they are applied using deltas (i.e. root motion) or absolute coordinates is controlled by the animator ‘Apply Root Motion’ flag, not Timeline.
So, turning off root motion, doesn’t turn off timeline actually outputting root transform information. The animation tracks have an all or nothing approach to root transform animation - if one clip has root motion, or animates root transform, then the entire track outputs root transform information every frame.
What you described is expected behavior, at least from each systems standpoints, but not necessarily a good or expected workflow.
For your use case, however, assuming the ‘air brake’ is in Timeline you could override the root motion instead of disabling it by doing the following:
Create an override track.
Record the desired root motion where the air brakes clip is.
Convert that to a clip track and turn off the clip extrapolation. Maybe add some ease-in/out so it blends to/from the parent track.
Adjust the clip offsets on the parent track on the first clip after the overridden section to account for the change in root motion on the override track. The split tool can be useful here if you are overriding a portion of a larger clip.
The air brake isnt really a animation and i disable rootmotion even when falling. how do you suggest i bypass this then? Also note i get rid of the player’s animator reference in timeline immediately after the cutscene stops
Forgot to notify , I fixed it by making runtime animator controller null and in the second line i assigned the animator controller again.
The airbrake was not part of the time line it was used for dev testing.