the joystick does not work as expected when i slide the joystick down the train moves up and vice versa when i push up train moves down.
I would like to reverse that please.
here is code
using UnityEngine;
using System.Collections;
using UnityStandardAssets.CrossPlatformInput;
public class joystick : MonoBehaviour {
public float TrainSpeed = 50;
public float TrainRotateSpeed = 50;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.Translate(0f, 0f, TrainSpeed * CrossPlatformInputManager.GetAxis("Vertical") * Time.deltaTime);
transform.Rotate(0f, TrainRotateSpeed * CrossPlatformInputManager.GetAxis("Horizontal") * Time.deltaTime, 0f);
}
}
Add a minus before TrainSpeed:
transform.Translate(0f, 0f, -TrainSpeed * CrossPlatformInputManager.GetAxis("Vertical") * Time.deltaTime);