Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 Start () {


function Update () {
    transform.Translate(Vector3(-1 * speed * Time.deltaTime, 0, 0));

function OnCollisionEnter (col : Collision) {
    if(collided_with.tag == "Left"){

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?

share|improve this question
I would be aware of how fast is your item going as this can affect if it collides at high speeds. If the speed is too high then the next position update before it hits a "wall" is going to place the item behind the wall without a collision activating. – Blue May 19 '14 at 13:01
up vote 3 down vote accepted

Collider is only one piece of the puzzle -- it detects a collision -- but each object in the collision should also have a Rigidbody attached if you want an actual collision response.

Also, depending on the speed, you may need CCD - Continuous Collision Detection.

share|improve this answer

You should consider using a RigidBody on some of your objects. There are 3 types of collision detection for a RigidBody component. Discrete is fastest, but it can result in the "bullet through paper" problem that you are having.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.