Rotation with Right Stick

I have the Logitech F710 controller and I am trying to get the rotation of a Character, like in most FPS games where you move the stick left and the character looks left and stops when you let go of the stick.

I suppose this controller will appear in the Input manager like any other gamepad. Usually the left stick is associated to the “Horizontal” and “Vertical” axes, and to access the right stick you will have to create two new axes in the Input manager (menu Edit/Project Settings/Input). Increment by two the Size parameter at the top of the Input Manager, then name the new axes as “RightH” and “RightV” (for instance), and set their characteristics. In my joystick (a popular chinese generic gamepad), RightH is the 3th axis, and RightV is the 5th one:

alt text

If you just want the camera to look right/left/up/down with the right stick, you can attach to the Main Camera a script like this:

function Update () {
  var angH = Input.GetAxis("RightH") * 60;
  var angV = Input.GetAxis("RightV") * 45;
  transform.localEulerAngles = Vector3(angV, angH, 0);
}

If you’re using the First Person Controller prefab, disable MouseLook.js in the Main Camera (MouseLook also exists in the First Person Controller, but it’s used to rotate the character right and left - don’t disable this instance).

hes right, but he forgot the “new” Beside the “Vector3(angV, angH, 0);” IF UR ON C-SHARP…C#