I have MouseLook working fine. I'd like to add the 'left' and 'right' arrow keys to TURN my camera (rather than strafe it). Having trouble mapping input to such. Tried adding left and right to the MouseX and Horizontal inputs, did nothing. What am I missing?
Answer by DaveA
Aug 24, 2010 at 08:24 PM
You need to set up two new Inputs with Edit/Project Settings/Input. Call one Right and the other Left. Set the appropriate keys in the fields there, only setting the 'positive' ones. Type is 'key or mouse button'. In your script, check Input.GetButton("Left") (likewise Right) and add/subtract from rotation based on deltaTime.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
No one has followed this question yet.
C# inputString mouse Keys?
Simple Object Dragging
Strange Camera Behavior on iOS - Runs perfect in Unity
Input.mousePosition Dead Zone - See gameplay
Move camera with mouse (2D)