- Home /
Any suggestion for third person aiming animation ?
Currently I have a prototype of my third person game that requires an aiming animation, the problem is that I still have no idea how to accomplish this. My intention is to get the character aim up or down according to the position of mouse cursor while running, but at this point, I can only get the character running by using the MOCAP animation provided by the Unity. I need the upper body of the character to move itself independently from the running animation I already have. Is there a way to accomplish this ?
Answer by mclankyman · Mar 02, 2014 at 09:49 AM
You should be able to accomplish this using inverse kinematics. However I think this requires unity pro.
Firstly make a new avatar mask which will only animate the upper body.
If you have an animation controller create a new layer which overloads the base layer and uses this shooting avatar mask. So it should have a weight of 1.
Then you could use the ScreenToWorldPoint method with the mouse co-ordinates to find the target you were aiming at in world space .
Then using Inverse Kinematics, somehow get the arms to point towards this target.
something like animator.SetIKPosition(AvatarIKGoal.RightHand,targetPosition);
Sorry I couldn't be more help but I have never used IK, only read about it.
Here is some information.
http://docs.unity3d.com/Documentation/Manual/InverseKinematics.html
Your answer
Follow this Question
Related Questions
Help with humanoid set up! 0 Answers
Is it possible in mechanim to have a state be clamped? 0 Answers
What is the best way to slow down the character before reaching the wall 0 Answers
How do I tell if a Unity 4.0 Animator is finished? 2 Answers
What does the "FootQ" property in humanoid animation clip stands for? 0 Answers