+4 votes

Hey all :)

First off, I just want to say that I love Godot and I'm having a lot of fun playing around with it. That said, I am quite new to it so I apologise if I'm missing something really obvious.

For reference, I am using Godot 3.1 Alpha 5.

I'm trying to recreate a classic "stacking" game, but the physics just doesn't seem quite right. I am using RigidBody2D for the blocks and a StaticBody2D for the ground. However, the blocks seem to "slip" or "compress" sometimes that causes the stack to topple over or the middle blocks to move out of the side.

I have tried increasing the mass, which helps a little. I have tried adding a PhysicsMaterial with high friction which helps a little. But something is still not right. Even with a near perfectly aligned stack of blocks, all of sudden the entire tower compresses vertically then collapses, pushing blocks out of the side. It's quite strange.

To give an idea of what I am trying to emulate, imagine concrete blocks. They won't compress or slip out the sides, but they would topple if the weight at the top is uneven.

Also, when a block first hits the ground it appears to go into the ground body, before being pushed back out to the boundary. Is there a setting to prevent bodies from entering each other? Maybe increase the physics computation?

Apologies if this is not a clear question, and let me know if any more info would be helpful. Thanks for any hints/tips/advice you can offer!

in Engine by (382 points)

1 Answer

0 votes

This is a known bug: https://github.com/godotengine/godot/issues/2092
Increasing Physics Fps in the Project Settings may make the jittering less noticeable at the cost of higher CPU usage.

Handling stacked RigidBodies has always been a difficult problem to solve in a physics engine.

by (12,869 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.