Too late collision

Hi guys, I am new in Panda3D and I am doing Arkanoid game for the start.
I have problem with collisions. Sometimes the collision is detected when the ball enters in half into the wall/block
and in other time it reflect correct just when there appear tangent point. I am using collision boxes for the walls and blocks and collision sphere for the ball. Also, when the ball hit into the corner of the collision box it fall into the block it is blocked.
What can be the reason of such problems?

Welcome! :slight_smile:

This may be the result of “tunnelling”: In general, an object is moved by changing its position on each update in accordance with its previous position and current velocity. This essentially “teleports” it from point to point, without it really passing through the intervening space. As a result, if the ball is moving fairly fast–a significant fraction of its radius per update, perhaps–then it may “miss” collisions, or only detect a collision when it is already well within the object with which it is colliding.

If you’re using the built-in physics system, then the manual offers at least one solution, I believe. If you’re using another physics system (such as Bullet), then that system may offer something similar.

Hmm… This may be an issue with the “box” collider–I seem to recall having previously encountered something similar. If this is the case, perhaps try collision tubes for your bricks–if a single tube isn’t a good match for your geometry and intended collision responses, you might get away with using four tubes, one along each edge of a given brick.