- Home /
This question was
closed Apr 25, 2016 at 12:09 AM by
EllDoubleYew for the following reason:
Solved the problem myself. See my comment for details.
Question by
EllDoubleYew · Apr 25, 2016 at 04:31 AM ·
rigidbodytriggerrigidbody2d
Box Collider Trigger never being triggered.
So I have a circle collider with a rigid body passing through an invisible box collider that is set as a trigger. I have written a simple script for the invisible 2D box collider with the following function
void OnTriggerEnter(Collider other){
Debug.Log ("Triggered by: " + other.name);
}
The problem is that this function is never called when the ridgidbody passes through the trigger box collider. How can I make this function log the message to the console?
Any help is appreciated, thanks.
Comment
Solved my own problem. I am working in a 2D environment so I needed to be using OnTriggerEnter2D and a Collider2D rather than in my example above. Sorry folks.