Here is the script below. it doesnt come up with any errors when i ude debug. but my car doesnt move
help im new to everything.
var forwardSpeed : float = 3;
var turnSpeed : float = 2;
function Start ()
{
//this is the speed at which it will move forward
var forwardMoveAmount = Input.GetAxis("Vertical")*forwardSpeed;
//actual turn amount
var turnAmount = Input.GetAxis("Horizontal")*turnSpeed;
//rotate the vehicle
Transform.Rotation(0,turnAmount,0);
//push the vehicle forward with a force
rigidbody.AddRelativeForce(forwardMoveAmount,0,0);
}
Try to put the code into the FixedUpdate function instead of the Start function.
Ok try this
var forwardSpeed : float = 3;
var turnSpeed : float = 2;
function FixedUpdate ()
{
//this is the speed at which it will move forward
var forwardMoveAmount = Input.GetAxis("Vertical")*forwardSpeed;
//actual turn amount
var turnAmount = Input.GetAxis("Horizontal")*turnSpeed;
//rotate the vehicle
transform.Rotate(0,turnAmount,0);
//push the vehicle forward with a force
rigidbody.AddRelativeForce(forwardMoveAmount,0,0);
}
wow. it turns now lol cheers.
If its not too much to ask. what am i missing to make it move forward ?
change this line:
//push the vehicle forward with a force
rigidbody.AddRelativeForce(forwardMoveAmount,0,0);
into this:
//push the vehicle forward with a force
rigidbody.AddRelativeForce(0,0,forwardMoveAmount);
It’s just that you told the script to make the object move on the X axis instead of the Z axis.
Doesnt work. maybe theres a problem outside of the script. and the Y axis is the one which the car moves forward i thougt it would be that instead of the Z axis ?
Well I had the same problem I attached the script to a box and when I thought it would move forward it moved sideways because the Z axis was the direction that faced forward.
it cant be the script becasue ive tried X,Y,Z axix and still it doesnt budge
Are you sure you attached a rigidbody component to the object you want to move? Don’t you get any errors in the console?
Its attached alright. and no errors at all.
That’s strange indeed. I attached the script to a simple box, then attached a rigidbody component to it and disabled the gravity so the box hangs above the ground and there’s nothing like friction that keeps the box from moving. Maybe you can try that too.
Tried that and still nothing. ill try restarting unity
Update:Restaring did nothing
I don’t think that’ll solve the problem but be my guest 
heres the video i followed and im pretty sure ive doen everything right and yet the car wont move forward!
With all the respect I can’t be bothered to watch a video of that length. If the problem persists you could take a look at this article that also has a project included with a working car that you can easily modify to your needs.
http://www.gotow.net/andrew/blog/?page_id=78