0
votes

I am trying to create a block breaker game in Unity 3D but I am having problems (this is my first time creating a game). When I throw the ball it ends like this https://gfycat.com/LimitedVagueAnkole. The physics between the ball and the bricks should be problematic i think but I don't know why. My ball's material is frictionless and its bounciness is 1. My bricks materials are None (physics material).

I can send more info if it helps but I don't really know what else to send.

PS: I didn't code the breaking of the bricks yet. I just don't understand why the ball isn't acting the way it should.

1
this seems to be a common problem people have when you stack boxcolliders next to each other, if another collider hits inbetween the two boxcolliders, it can catch or bounce off at a weird angle. a workaround i've used in the past that seems to work is use 4 edge colliders instead of a box collider. I personally don't know of a more elegant solutionryeMoss
Maybe having a common collider for adjacent bricks? Or maybe using edge colliders? Or even better: Using a Tilemap with TilemapCollider2D?Rodrigo Rodrigues
How can I destroy the individual bricks if i have a common brick for all of them tho? And I don't know what tilemap is yet but i will try to look it up. Thank you!OgiciBumKacar

1 Answers

0
votes

The same thing is happening to me, I think I have a solution for this problem. I think the reason why the ball keeps bouncing at one place is because the ball didn't have much speed to escape from the loop. Try increasing the speed of the ball a bit and you could see the ball indeed escape bouncing at one particular angle.