- Home /
Third Person Character locking root position even when disabled
I have a ThirdPersonCharacter script that animates my character when said character moves using the NavMeshAgent. I wish to turn this behavior off, take control of the character with a PlayableDirector and once it is done, return everything to the way it was.
After a long long time I have figured that the reason I was unable to take advantage of the root transform offset feature in the Timeline was said ThirdPersonCharacter. Somehow, someway, it is locking my root transform. I've disable the script and made sure none of its functions are running, but the root transform is still locked. Only Destroying the component finally releases the root transform and allows the PlayableDirector to do what it needs.
I would very much like to not have to destroy and re-add the component for my game to work, but I am unable to find what destroying does that disabling doesn't. Please help.
Answer by ArseneySorokin · May 24, 2020 at 11:26 AM
It turns out that the function OnAnimatorMove(), when existing, overrides other root motion movements, even if the component containing said function is disabled or the function is empty.
The way to solve this is to add GetComponent().ApplyBuiltinRootMotion(); to said function when you wish to release it.
Your answer
Follow this Question
Related Questions
Rotate character to camera orientation(direction camera is facing) 0 Answers
Timeline, Whats happening Under the Hood: with multiple AnimationTracks for same gameobject 1 Answer
How to loop root motion in timeline? 3 Answers
How to animate the rotation of an actor which is moving forward via root motion during timeline? 0 Answers
How to handle Scripted root motion with timeline animation track? 0 Answers