Godot Version
v4.2.2.stable.official [15073afe3]
Question
I am trying to make a container full of rigidbodies that the player can pick up in my game. The container is a AnimatableBody2D and I extended it to add gravity, be able to be picked up and moved by the player and I added a shapecast to detect other objects and not travel through them.
I had a problem that seemed like tunneling to me because if the container is being controlled by the cursor then obviously you could move your cursor very fast and then all the objects being contained would tunnel through the walls of the AnimatableBody so I restricted the amount of travel that can happen in each frame. But, I’ve ran into another problem that seems slightly different that leads to the rigidbodys phasing through the walls of the container. When the container gets up to any amount of speed (the container has a max speed of around 1800 * delta move per physics frame) the rigidbodies start to get pushed into eachother which leads to them clipping through the walls.
heres a slowed down gif of it happening Imgur: The magic of the Internet
Ive tried increasing the physics frames to 90 and 120 and the amount of rigidbodies that clip through seem to get less as I increase it but they persist. I don’t think I can really decrease the speed you can move the container anymore because if I do it’ll make the container feel even more unresponsive to cursor movement. Is there a way to stop the rigidbodies from cramming together like that or what would be another solution?