- Home /
Aim down sights help
im new at unity and i wanted to make a first person shooter where i can aim down sights this is the code but it doesnt work. it tells me input q is not set up when i do have both vectors set up
var HipPose : Vector3; var AimPose : Vector3; function Start () { transform.LocalPosition = HipPose;
} function Update () { if(Input.GetButtonDown("q")){ transform.localPosition = AimPose; }
}
Answer by Unitraxx · Apr 10, 2013 at 10:58 PM
Input.GetButtonDown
is for buttons that have a name defined :
http://docs.unity3d.com/Documentation/ScriptReference/Input.GetButtonDown.html
Use Input.GetKeyDown
instead :
http://docs.unity3d.com/Documentation/ScriptReference/Input.GetKeyDown.html
Your answer
Follow this Question
Related Questions
Multiple questions on making an FPS 5 Answers
How to move a characters arm when an animation is playing 3 Answers
Can you change the speed of a raycast? 1 Answer
Need Help Aiming Smoothley 1 Answer
FPS Multiplayer Scoreboard Problem 0 Answers