What is wrong with my code?

Well,
I’m following a tutorial on YouTube for a first-game in Unity.

In this case driving around in a car.

I’m trying to rotate my car left and right, but with no movement.
So when I’m pressing “W” It’s going forward,

But the problem is:
When I press “D”, it goes right indeed, but it goes forward as well!
When I press “A”, it goes left indeed, but it goes backwards as well…

When I press “W” + “A” it goes super-slow forward and turns left,
When I press “W” + “D”, it goes super-fast forward and turns right.

What could be wrong?
(This is C#)

using UnityEngine;
using System.Collections;

public class CarAll : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		if( Input.GetKey ( KeyCode.W) ) {
			transform.position += transform.forward * 5.0f * Time.deltaTime;
		}
		if( Input.GetKey ( KeyCode.S) ) {
			transform.position -= transform.forward * 2.0f * Time.deltaTime;
		}
		
		if( Input.GetKey ( KeyCode.A) ) {
			transform.Rotate( 0.0f, -80.0f * Time.deltaTime, 0.0f);
		}
		if( Input.GetKey ( KeyCode.D) ) {
			transform.Rotate( 0.0f, 80.0f * Time.deltaTime, 0.0f);
		}
	}
}

I would suggest you find another tutorial which shows you to do the same thing but with physics.
Physics makes movement more natural, and obviously, a car moving in the real world is indeed physics. :wink:

Your script works fine for me. Do you have any other scripts that affect the object?

Well… I don’t know what may be wrong D:

I’ve added a zip-file of my project if any care to look and tell me if they find the mistake…
1268597–56263–$firstGame.zip (109 KB)

From this description it seems like your object’s pivot point is somewhere to the right of its actual center. If you select the car object in the editor with the tool handle position set “pivot” and not “center” (i.e. you want the word “pivot” to be displayed on the fifth icon on the toolbar), does the editor the show the transform handle at the center of the object or is it off to the side?

I can’t find the mistake…
Pivot point seems to be correctly, and yeah…