- Home /
How to use 1 animation controller for a character and an animated object ?
Hello everyone. How do you use 1 animation controller for a character (with its animations) and an animated object synchronized to the character ? In particular I have as character the animation of an archer without a bow and as an object a bow with its animation. I would like the archer to hold the bow in its hand and that the 2 animations activate at the same time (for example with the use of a trigger). It's possible ?
Answer by MartinIsla · Feb 05, 2019 at 04:53 AM
Sure. I think what you want here is to use animator layers (that's the keyword, google it!)
Create a new animator layer for the bow. Drag the animation clips of the bow to that layer. Now connect the states so they respond to the same parameters as the player. Be happy. Get coffee. Think of me while drinking that coffee.
Answer by giorgik63 · Feb 05, 2019 at 12:37 PM
Thank Tiiiincho, until then I had arrived too, but the problem is to match the movement of the hand that takes the string of the bow and the curtain, with the animation of the string that stretches (which would be the second animation, the one you suggested to do).
Yes! If you use the same parameters in the animator to trigger both the bow and the hand animation states, they should trigger at the same time and therefore be synchronized.
I’m thinking you should also sync the bow layer to the hand layer (you do that with the tiny gear next to the Bow Layer in the layers list).
Say you have a bool IsAi$$anonymous$$g and Idle -> Ai$$anonymous$$g transitions in both the hand and the bow layer, with the condition set to “IsAi$$anonymous$$g = true”. When you call anim.SetBool(“IsAi$$anonymous$$g”, true) in your script, each layer would set the right state. The hand would do the movement and the string in the bow would be stretched
$$anonymous$$eep me posted!
Tiiiincho, I'll explain to you my situation better. I downloaded the character Erika Archer Bow with Arrow from $$anonymous$$IXA$$anonymous$$O and the animation of Erika that pulls the arrow but with the bow of the bow. What I want to do and create the animation of the bow that bends when Erika executes the shot and then the hand of Erika who takes the bow and pulls it (as in the animation I downloaded, but that does not take the rope, but mimics the action).
The question is: can you change the animation to do what I want and how ?