- Home /
The question is answered, right answer was accepted
Bouncing the ball off a collider and destroying it using trigger
I am making a Breakout game and in it I have made several bricks with boxcollider and the ball is a rigidbody with circlecollider. I have used the PhysicsMaterial2D and set the bounciness to 1. So the ball is bouncing back when it hits the bricks. Now I want to destroy the bricks as soon as the ball touches them and still bounce back. I am not able to use OnTriggerEnter2D because if I enable the isTrigger property then the brick's collision property is automatically turned off.
Any idea how I could pull this off?
I got the answer here. Posting for reference. Ins$$anonymous$$d of trigger, I had to use OnCollisionEnter2D.
Follow this Question
Related Questions
OnCollision2D will not work for me 1 Answer
Avoid Initial Collisions,Avoiding Initial Collisions 1 Answer
How to detect if character Joint Broke ? 0 Answers
collisions does not get detected every time 0 Answers
What does it mean to be "grounded"? 0 Answers