Question by
mhyland · Sep 15, 2015 at 10:25 PM ·
collidersontriggerenter
on trigger enter 2d not working
ok so I did everthing I was supposed to do everything has 2d box colliders and it is all tagged, take a look and the debug.log did not show up
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D(Collider2D other){
Debug.Log ("hi");
if (other.gameObject.tag == "enemy") {
Destroy (other.gameObject);
}
}
}
Comment
If Debug Log didn't show up then you did something wrong. Either IsTrigger is not checked or none of the colliders have Rigidbody or script is not attached......
Your answer
![](https://koobas.hobune.stream/wayback/20220612033803im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Triggers Colliding With Triggers Not Working? [Solved] 1 Answer
How Do I make a 3D Numbered Padlock? 0 Answers
Collider ClosestPoint and ClosestPointOnBounds are just returning the point I pass them? 0 Answers
Calling "OnTriggerEnter" when a parent object has a rigidbody 0 Answers
Setting OnTriggerEnter to a second object collider 2 Answers