Hi guys, I’m currently developing a game for android and before moving onto the artwork, I decided to work on the control systems and make sure they work correctly. However I seem to be having trouble getting the touchpad to work.
I wrote two different types of code, one worked using the keyboard, the other didn’t work at all.
The keyboard working code is:
var speed : float = 1;
function Update () {
var movementz = Input.GetAxis (“Vertical”) * speed;
var movementx = Input.GetAxis (“Horizontal”) * speed;
transform.Rotate(movementx, 0, movementz);
}
The none working code is :
var movement : Vector3 = Vector3.zero;
var speed : float = 1;
function Update () {
movement.z = Input.GetAxis (“Vertical”);
movement.x = Input.GetAxis (“Horizontal”);
transform.Rotate(movement * speed);
}
the touchpad is set up for a 50x50 pixel size at position 0,0,0 so it is in the bottom corner of the screen with a dead zone (normailised) at 0.5, 0.5.
I checked the input axes and one set is set for keyboard and another set is for joystick (Which I’m assuming is standard)