- Home /
Character Aiming
Hello, i would like to know how do you make the player to aim? i will try to break it down to 2 questions:
A) How can i make the player aim towards the camera? are the arms animated to go on front of the camera?.
B) How can i make the arms trigger the animation to go towards the camera by pressing ("Right Mouse Button")?.
Thank You!
Answer by save · Jul 16, 2011 at 08:38 AM
Yes, use an animation to bring the object into position. It's much easier to create animations outside of Unity in an external 3d-program, especially if the arm is a skinned mesh. Then you can set the animation to clamp for instance. To later play the animation use something similar to this:
if (Input.GetMouseButtonDown(1)) {
animation.Play("aim");
}
Read up on animations in the script reference and the manual, there's much on animations but very easy to manage once knowing their functionality. This video is also very helpful.
Your answer
Follow this Question
Related Questions
Play sound on trigger, sound is coming from the trigger 1 Answer
Script on moving object doesn't work? 1 Answer
Initiate Animation 0 Answers
Activating One Part of An Animation 2 Answers
play animation on keypress if in range 3 Answers