Collision Detection between two different Prefabs doesnt work
So i have two Prefabs (on of them is a Bullet, the other one is a standing Object spawned "by the player"), which i want to collide and get destroyed. When i put the script down below on my Player and run into the spawned Object with the Tag "Shot Target" it gets destroyd, but when i have the Script on my bullet, there seems to be no Collision between the both. Anybody got an Idea?
void OnCollisionEnter(Collision col)
{
if (col.gameObject.tag == "ShotTarget")
{
Destroy(col.gameObject);
}
}
Comment
Your answer
Follow this Question
Related Questions
Cannot detect trigger 2 Answers
I need a good turorial to get me started - c# 2 Answers
Sphere is not using OnCollisionEnter/OnTriggerEnter/OnCollisionStay/OnTriggerStay functions 0 Answers
Checking for a gameobject at a position 1 Answer
My main character isn't being able to colide with the objects. 1 Answer