Doing udemy Game dev course and stuck here


It keeps saying error and I’m trying to be able to use the arrow keys togo back and forth

Hi Shana_W,

Welcome to our community! :slight_smile:

What error are you getting? Unfortunately, I cannot see any in your screenshots. Your code looks correct to me.

Since it’s weekend, we teaching assistants will be back on Monday. Since this looks like a rather simple problem, you could ask our community of students for advice over on our Discord chat server. Maybe they’ll be able to help you faster than I.


See also:

public Driver : MonoBehaviour

{

[SerializeField] float steerSpeed = 1f;

[SerializeField] float moveSpeed = 0.01f;

void Start()

{

}

void Update()

{

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

    transform.Rotate(0, 0, steerSpeed * steerAmount);

    transform.Translate(0, moveSpeed, 0);

}

}

I keep going in a circle I dont understand how to make it so my arrow keys go right and left

The car is supposed to move in a circle if you press the A, D, left arrow or right arrow key on your keyboard. That’s exactly what happens in the video, too.