The "shot" is supposed to collide with the left bumper and then be destroyed, but the shot goes right through it. Both objects have a box collider.
The following is the code I am using:
#pragma strict
var speed : int = 2;
var collided_with : GameObject;
function Update () {
transform.Translate(Vector3(-1 * speed * Time.deltaTime, 0, 0));
}
function OnCollisionEnter (col : Collision) {
if (collided_with.tag == "Left") {
Destroy(gameObject);
}
}
I have made sure that all the tags are assigned correctly and that there are no spelling errors. The variable collided_with is also assigned to the left bumper. What am I doing wrong?