how can i stop the object going through the other object... i have a script that makes my object move around but it still goes through object...what should i do now so i dont make the ojbect go through the other objects... here is the script...
var speed : float = 5;
var turnSpeed : float = 10;
function Update ()
{
transform.Translate(Vector3.forward * speed * Time.deltaTime);
if (Input.GetKey(KeyCode.A))
{
transform.Rotate(0, -turnSpeed * Time.deltaTime, 0);
}
if (Input.GetKey(KeyCode.D))
{
transform.Rotate(0, turnSpeed * Time.deltaTime, 0);
}
}