If I have Joystick #1 (left) and Joystick #2 (right) on a scene, how would I name each Joystick in the ‘JoystickName Member’:
…so I can tell which Joystick is currently being pressed?
Ideally, I would like to assign the left Joystick to control x-axis (movement forward and back) and the Right Joystick to control y-axis (left to right looking, etc) or z-axis
void On_JoystickMove( MovingJoystick move){
if (Mathf.Abs(move.joystickAxis.x)>0) {
this.transform.Rotate(Vector3.up, Time.deltaTime * rotationSpeed *move.joystickAxis.x);
MovementDirty = true;
}
if (Mathf.Abs(move.joystickAxis.y)>0) {
this.transform.Translate(0, 0, Time.deltaTime * forwardSpeed * -move.joystickAxis.y);
MovementDirty = true;
}
}
Many thanks in advance