Ignore collision based on position
Hi,
I'm making a brick breaker game with a twist and need to make it so that if the paddle and the ball collide while in the left half of the screen the ball bounces as normal but in the right side of the screen it goes through, like below:
I've managed something easily by scaling the collider mesh so it never goes past the middle but that only worked when my paddle was a box with a box collider.
Is there anything such as a collision mask? Or a way to ignore a collision if the hit point was between certain coordinates?
Thanks.
A little update on this as I think I might've found the solution but I'm still open to better ones. I've added a Physics.IgnoreCollision(ball, paddle, true) if the ball is past the centre of the screen and Physics.IgnoreCollision(ball, paddle, false) if it's not.
Seems to be working for now but will need some more playtesting.
Answer by TheyLeftMe4Dead · Jan 16, 2017 at 05:17 AM
Another idea is to add OnTrigger colliders to both sides of the screen. If the Player is colliding with white AND the platform, ignore the platform.
Your answer
Follow this Question
Related Questions
How To how ?? 2 Answers
Collision or Triggers both not working. 3D. 1 Answer
Object refuses to collide 0 Answers
Why is my trigger collider acting like a normal collider? 1 Answer
Collision With Text 0 Answers