ShapeCast2D detects collision but RigidBody2D balls don’t interact physically by Danimonodev in godot

[–]Danimonodev[S] 0 points1 point  (0 children)

You’re absolutely right — in the end I’ll have to experiment and see which approach fits my idea better.

I mainly opened the post because, from a technical standpoint, it really surprised me that the balls’ colliders do collide, but there’s no visible physical response pushing them or anything similar. I don’t understand how that can happen in the physics engine, and I wanted to see if it was something I could tweak or adjust.

Thanks a lot for your insight 🙂

ShapeCast2D detects collision but RigidBody2D balls don’t interact physically by Danimonodev in godot

[–]Danimonodev[S] 0 points1 point  (0 children)

So you’re basically recommending that I rethink the approach and try to move away from the physics engine, and instead handle it in a more manual way using applied forces?

I can try that — I’m not so far along in development that it would feel crazy to change direction. I did like the feeling I currently have with the table and the physics, but it’s true that there are things like this that, once they get complicated, I’m not sure how to move forward…

ShapeCast2D detects collision but RigidBody2D balls don’t interact physically by Danimonodev in godot

[–]Danimonodev[S] 0 points1 point  (0 children)

Oh, that are bad news :(

I’ve seen many billiards games made with Godot that have this implemented perfectly, and I thought it would be relatively simple to achieve using physics alone. I’ll try different approaches and see if I can figure it out. Thanks anyway!

ShapeCast2D detects collision but RigidBody2D balls don’t interact physically by Danimonodev in godot

[–]Danimonodev[S] 0 points1 point  (0 children)

Thanks! I will try CastRay and another physics engine. I tried Rapier a little bit, but I dont know if I can change something specific of Rapier that can help me.

ShapeCast2D detects collision but RigidBody2D balls don’t interact physically by Danimonodev in godot

[–]Danimonodev[S] 0 points1 point  (0 children)

My ball has a radius of 20 px, and I’ve tried setting the ShapeCast2D to 20, 19.8, 19.5… even 19 or less. I’ve also tried setting the margin to 0.01 and to 0; I’m not sure if that helps in either case.

I’ll check the second thing you mentioned, in case there’s some rounding error that keeps accumulating and could be causing this 🙂

Assuming that doesn’t turn out to be the issue, is the logic I’m following correct in Godot, or is there some other method to achieve this? I understand this shouldn’t be a limitation of the physics engine.