How To Apply 1 Animation to Multiple Objects in Unity?
I made a selection of 3 different doors in Blender with only minor cosmetic changes to each. I brought the first door into Unity, "Door1". I made an opening-closing animation for it, listed in the Animator window as "Door1".
Next I brought in "Door2", thinking that because I have the option to select which animator to use, this meant that the selected animation will be applied to whatever I want. But when I selected the Door1 animator for Door2, Door2 refused to move.
Is it true that I will have to create seperate animations for every similarly-moving object I bring in?
Answer by rainChu · Feb 22, 2019 at 04:07 AM
As long as the rig is truly the same, you can re-use the same AnimatorController for each. You should have, on each door prefab, an Animator. Each Animator should link to the same AnimatorController. If you have slight variations on the animations, you can also use the AnimatorOverrideController, which lets you swap animations out, leaving the transitions and logic in it as-is.
So in summary:
Door1 -> Animator #1 -> AnimatorController #1 Door2 -> Animator #2 -> AnimatorController #1 Door3 -> Animator #3 -> AnimatorController #1
If this setup doesn't work, make sure the rigs are set up exactly the same- Same bone names, same name for the rig itself, etc.
Let me know if I answered your question, or if you need more help!
Your answer
Follow this Question
Related Questions
Animation looks super janky while the game is running 0 Answers
Can't play an animation from the Animator 1 Answer
Specific Animation not Playing 0 Answers
How to animate multiple objects in sequence? 0 Answers
duplicate enemies animations wont work? 0 Answers