Collision detector doesn't work

Hello,

I made a collision detecting function for my enemy controller script which is supposed to destroy both the object if it gets by a bullet along with the bullet itself

void OnCollisionEnter(Collision collision){
		if (collision.gameObject.name == "Bullets"){
			Destroy (collision.gameObject);
			Destroy (this.gameObject);
			print ("Collision detected!");
		}
	}

Sadly however no collision is detected even the “Collision detected!” line isn’t printed in the console

the line print (“Collision detected!”); will NOT be printed, since the object with the code is destroyed the line before Destroy (this.gameObject); <<<<<<, first of all, you need to see if the collision is triggering, put a Debug.log or print the first line of the OnCollision, verify the objects have a rigid body and a object collider, also verify if you are trying to have Colliders or Colliders2D, sometimes this makes the difference

Hello,

I’ve finally figured it out,turns out that there is something wrong with the model I’m using causing it not to register the collisions when hit in certain places but when I used a Cube and applied a rigid body to it the collision worked just fine :smiley: