- Home /
Collision Detection between two instantiate clone
I am making a shooting game in which instantiate bullets hits instantiate target but its not detecting collision . I applied rigid bodies for both. And I write script for bullet game object that is attached to First Person Controller. Here is My Script void OnCollisionEnter(Collision collide){
if(collide.gameObject.tag == "TARGET"){
print("hit");
Destroy(collide.gameObject); print("collide");
} }
Here TARGET is tag of the game object that is Instatiated(target). I am new in the unity so plz help me.. Thanks in Advance
I have addded BoxCollider in target game object and checked Is trigger still it's not responding
using OnCollisionEnter requires a collider NOT set to isTrigger, and at least one having a RIGIDBODY that is NOT kinematic.
Hope that helps.
Id recommend using OnTriggerEnter(). And be sure the object with the OnTrigger call is the one that is set to isTrigger. In your case, the bullet.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to Instantiate a GameObject from a ScriptableObject piece of script? 0 Answers
GameObject instantiation in C# static constructor 2 Answers
If Grounded 2 Answers