- Home /
How to properly place a rifle weapon into the Character's hands and change pose?
Hello,
I am using the 'StandingAim' animation from the Unity's Bootcamp demo. At the moment I am using a simple rectangular prism as my Rifle model and it is parented to the right hand of the Character. I applied the 'StandingAim' animation to my Character, the arms and hands are in the same position/rotation.
However the problem is how to I make my Rifle (a cube stretched into a rectangular prism) looks like it is being held in my Character's hands? Here are a couple of screenshots to demonstrate what I am trying to do.
The highlighted gameobject is my Rifle.
Idle Stance
The rifle is a child of the 'hand.r' (right hand) and it does somewhat looked like it is held properly.
However...
Aim Stance
As you can see the Character is in Aim Stance. When the animation is played the Rifle is misplaced. But not only the Character is in aim pose but he is also idling (idle) at the same time, that means his body is swaying, arms trembling, etc like any person will do. I merged two animations (Idle and StandingAim) via Avatar Masks.
But what I just want to do is to have the Rifle placed on BOTH hands (left and right). Because it is parented to the Right Hand, I want it to stick in the Left Hand too so it does not look like the Rifle is sliding/floating/clipping in the Left Hand (because Left and Right Hands animates separately at different position/height/etc)Is there a proper way to do that? Tutorials? Documentation?
Another important question - What if I have a variety of weapons? Lets say Weapon A has a unique Aim animation and Weapon B also has a unique animation. How do I tell Unity that if the child of the Right Hand is 'Weapon A' to play "Weapon A Animation". Or when Right Hand has a child named 'Weapon B' to play "Weapon B Animation".
Also I might just use an empty gameObject to attach the weapon to the hand. For example: Right Hand -> empty gameObject -> Weapon
I write in Javascript. Free version of Unity. Thank you.
EDIT: I am using Mecanim, Raw Mocap Data asset and Bootcamp asset. All animations are converted into humanoid.
Your answer
Follow this Question
Related Questions
Mecanim not updating script when it switches state? 2 Answers
Attack Animation through Javascript 0 Answers
Adding mecanim animations to an AI follow script 0 Answers
How to get the values of the animation? 0 Answers
Why isn't my animation being played? 0 Answers