- Home /
Rigidbody force?
Hello, I'am working on a car script and i would like the car to move forward when I press "W" for example :-) The car already has working WheelColliders, but how do I add force to the car in the car's direction?
Thanks, Andreas :-)
Answer by sparkzbarca · Mar 24, 2013 at 09:48 AM
rigidbody.addForce(transform.forward);
I can't seem to get it work, I put it in the Update void, but it has no effect on the car (the script is in the same gameobject as the rigidbody)
transform.forward * speed
though you put it in
void FixedUpdate (rididbodies only apply during fixedupdate) that shoudlnt have stopped it form working though
where is the blue line in the car when you select it in editor with local axes
So it should be rigidbody.AddForce(transform.forward * speed);?
And the blue line is to the left for the front of the car, can it be fixed in Unity, or should I rotate it in Blender? :-)
in blender yep your applying force left but its not enough force to overcome the resistnace of the wheels against the ground.
Your answer