Rigidbody car physics....

I’m making an iphone game and in it I have a car that can be driven.

It uses a box collider for the body, and a rigidbody which is pushed around with the AddForce function. I’m not using wheel rigidbodies or anything fancy, in order to keep things optimized.

The only issue I’m having is when the car collides with anything. When it smacks into a hard surface, it often slides left or right (the same way a normal rigidbody would shift around after a collision).

What I want to do is make it so that it can only move forwards/backwards in a given direction. That way I give it the effect of rolling on its wheels, which would not allow it to move in a sideways direction.

Is there any way to do this?

You can use a ConfigurableJoint to lock its local x-axis motion.