Joystick - third axis access

var speed = 5.0;

function Update ()
{
var x = Input.GetAxis(“Horizontal”) * Time.deltaTime * speed;
var y = Input.GetAxis(“Twist”) * Time.deltaTime * speed;
var z = Input.GetAxis(“Vertical”) * Time.deltaTime * speed;
transform.Translate(x, y, z);
}

I am using a three axis Logitech Extreme 3D Pro joystick and want to control three degrees of freedom (x, y, z) translation of th emain camera on a simple scene.

I succeeded with the “Horizontal” and “Vertical” Axes since they are provided in the scripting tutorial that comes with Unity3D. What is the name of the third Axis so that I can access it ? I tried Twist in the example above, but this does not work.

Try going to Edit->Project Settings->Input, you can see all the Input variables there. I never worked with a joystick in Unity before, but my first guess is to try this: After opening the Input properties, look to the right, there you will find the Horizontal and Vertical variables, also I guess you could scroll down and pick one of the variables such as Fire1, open it, give it a name, lets say “Z axis”, select Joystick Axis for the “Type” and Third Axis for the “Axis” property. Maybe then you could use something like

function Update () { var x = Input.GetAxis("Horizontal") * Time.deltaTime * speed; var y = Input.GetAxis("Z Axis") *

I’m not sure about this, but I guess it’s worth a try.
Hope it works :wink:

I tried it and it does not work.

:frowning:

I tried it and it does not work.

:frowning: