- Home /
Can't get OnTriggerEnter2D or OnCollisionEnter2D to work
I've tried both OnTriggerEnter2D and OnCollisionEnter2D and neither are recognizing when my bricks are moving through the 2D collider I have set. I have a tag on my 2D collider called "EndScreen" and I have tried having the bricks be a trigger and having the 2D collider be a trigger. Neither worked. I do not have a Rigidbody2D on these bricks. Do I need one, and if I put one on there is it going to effect anything else, or can I set it so no other physics or anything is acting on it and everything behaves the same?
Answer by MarioSantoso · Apr 21, 2018 at 04:49 AM
For every object that's going to be moved around by physics, please add rigidbody or rigidbody2d.
As for ontriggerenter and oncollisionenter, please open the documentation here as unity already provide ample explanation of what condition needed to trigger that functions.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Count time between scene executions 1 Answer
Making a bubble level (not a game but work tool) 1 Answer
"fillamount" not appear! 0 Answers