in my game the car moving automatically and the player just moves left and right by moving his finger on touch screen. I need to correct my script…
var forwardSpeed : float = 3; var turnSpeed : float = 2;
function Update() {
var forwardMoveAmount = Input.GetAxis(“Vertical”)*forwardSpeed;
var turnAmount = Input.GetAxis(“Horizontal”)*turnSpeed;
transform.Rotate(0,turnAmount,0);
- transform.Translate(Vector3.forward *Input.GetAxis(“Vertical”)Time.deltaTime30);
- if(Input.GetKey(“escape”)){
- Application.Quit();}