- Home /
How to edit the looking on the FP controller?
As you know, the default Unity FPS controller uses the mouse to look around and aim the character, and the keys to strafe and move. Instead, I would like the forward and backwards to stay the same, but the left and right arrows to rotate the character, freeing up the mouse for interaction. How would I go about this?
Hi Joe, a question before an answer. How do you expect the vertical portion of the look to behave? Will it be controlled manually, for example by "look up" and "look down" keys? Or do you need it controlled automatically in some way.
Answer by lhk · Oct 29, 2010 at 01:28 PM
You can edit the Script. Replace the original Update function with
void Update ()
{
transform.Rotate(0, Input.GetAxis("Horizontal") * sensitivityX, 0);
}
By doing this you read the Input nor from the Mouse but instead from the Axis Horizontal which should map to the right and left key.
Your answer
![](https://koobas.hobune.stream/wayback/20220613011719im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Modifying the FPS Walker script 1 Answer
When my button is pressed the action reapeats 1 Answer
How To Make Ammo & Realod for Gun & Spark for Gun ? 0 Answers