- Home /
using left right keys to turn
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?
Comment
Best Answer
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.