Keyboard input does not seem to work but I am getting no error message

Not sure if I did something wrong but I am not getting any response from my arrow key input. Any ideas?

Here is my code:

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class RotateCar : MonoBehaviour

{

[SerializeField] float steerSpeed = 0.01f;

[SerializeField] float moveSpeed = 0.01f;

void Start()

{

   

}

void Update()

{

  float steerAmount = Input.GetAxis("Horizontal");

  transform.Translate(0, moveSpeed, 0);

  transform.Rotate(0, 0, steerSpeed);

}

}

Ooops I figured out what I had wrong there. It doesn’t seem to slow down when I rotate while moving forward but I got the other controls to work.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms