x


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?

more ▼

asked Aug 24, 2010 at 05:21 AM

DaveA gravatar image

DaveA
33.7k 419 347 514

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Aug 24, 2010 at 08:24 PM

DaveA gravatar image

DaveA
33.7k 419 347 514

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5112
x1651
x1484
x71
x64

asked: Aug 24, 2010 at 05:21 AM

Seen: 2916 times

Last Updated: Aug 24, 2010 at 05:21 AM