How to easily animate child objects
I have a prefab in my scene and I want to be able to create animations for it. Each animation should be controlled by one animation controller (applied to the prefab root) but the actual properties that are animated will be child components of the prefab.
My problem is that when I select the prefab, and choose create animation in the animation window like this....
Now if I click on a sub object that I wish to animate, the animation in the animation window disappears....
I can add the object manually, by selecting add property, and choosing the right object from the list etc... But I really don't want to have to do this.. this is a time consuming way to create keyframe animations.
Is there anyway I can change this behavior?
If you select a child that has another Animator component on itself or a parent the record button will be deactivated. The Animation window padlock needs to be locked.
Answer by Pengocat · Feb 21, 2017 at 08:55 AM
You can click and lock the little padlock in the upper right corner of the Animation window to not lose focus when switching to a child object that has another Animator component as nearest parent. Then simply have the record button active and start changing the property you want to animate and a key-frame will be added.
The alternative is to only have one Animator controller in the hierarchy tree going upwards so the focus will not be lost.
@Pengocat Awesome, thanks for that. I think my problem was that I had animator controllers on some of the child objects by mistake. But I didn't even realise there was a lock button! $$anonymous$$assive time saver!
The lock is very easy to miss. I'm glad it helped you.
Your answer
Follow this Question
Related Questions
How does one copy and paste keyframes in the Animation Editor? 4 Answers
Problem with Mecanim Transition Preview window 0 Answers
not showing onPreviewGUI in StateMachineBehaviour Editor 0 Answers
Disable automatic anim "Loop Time" check box 1 Answer
Animation previous keyframe button is not working in Unity 2019.3.3f1? 2 Answers