Godot: Pile of RigidBody2Ds results in overlapping and shaking

Created on 15 Jun 2015  Â·  22Comments  Â·  Source: godotengine/godot

Dump a bunch of rigibody2d's with rectangle collision shapes into a pit so they pile on top of each other, and the ones at the bottom are forced into each other. They overlap significantly, and constantly shake around as they try to resolve their colliisions.

Example:
https://copy.com/YWldXOFC18N1oYRk

bug confirmed physics

All 22 comments

One way to solve this is change fixed_fps of 60 for 180, with this value looks good for me.
I don't know if the option "Continuous Cd" (I think this should be Continuous Collision Detection) works. I never saw any difference with this option.

Lol, that's hypnotizing :D
I can confirm that the bug is still reproducible using the minimal example included above in the current master branch.

There's a video showing this bug: https://www.youtube.com/watch?v=LYy3NTBElO4

Will fix this in 2.1, as I will probably switch to a less beautiful but more useful contact point generation code.

i think i fixed this bug a few weeks ago, but i can't download the test case

New test case: test_rigidbody.tar.gz

I tested it with v2.0.4.1.stable and isn't working.

I can still reproduce the bug in 2.1-beta using the above test case.

I guess #515 might be a duplicate of this bug (or the other way around, as you prefer ;)).

Not critical for the upcoming 2.1, so moving to the next milestone.

Just tested @guilhermefelipecgs' test case on master branch and this bug still occurs.

What's the status of this bug in the current master branch?

Still happens.
Tested with this commit 6f63a01302355077af2459c96a17e299c32b2960
Test project updated for version 3.0 test_rigidbody.zip

Hmm. I was convinced that this was fixed eventually.
Will have to leave for 3.1, as the plan there is to rewrite much of the 2D and 3D physics engines.

Unfortunately leaving it for 3.2, Did not manage to find time to make the many changes to the 2D engine I desired.

Anyone working on this?
It's still reproducible in current master https://github.com/godotengine/godot/commit/4ee8ecd3efee742be58c1ff191e78d0de09b57b6.

Anyone working on this?
It's still reproducible in current master 4ee8ecd.

Nop, I'm sure that would have made a big entry in the Godot Breaking News
But at least the RB implementation is not completely broken. Chris has found and documented a simple workaround for kinematic → rigid body interaction:
http://kidscancode.org/godot_recipes/physics/kinematic_to_rigidbody/

Any news on this? It's rather important issue.

@vonedo3011 As far as I know, nobody is currently working on this. reduz might take a look at it for 4.0 if time allows.

How's the progress on this?

@evah5 Same as before, I haven't seen anyone work on this lately.

I found an interesting bug, its probably related to one of this issues mentioned, here is the minimal reproducible example:
https://drive.google.com/file/d/1RhAzoUwNByq3OjqMgxq9xYNBAtxDnP6z/view?usp=sharing

I tried to increase the fps as suggested here but this only work once or twice, after that the rigid bodies on my scene start to overlap and shake again if you keep pressing the space bar.

I'm still not sure if this is a bug or I'm doing something wrong...

From discord:

https://discordapp.com/channels/212250894228652034/342056330523049988/703046144208666714

@ btzr Today at 7:54 PM
Is there a safe way to disable and enable a collision shape and change the RigidBody2D mode from character to rigid at the same time ? I end up with this bug where they are overlapping and shaking...

Basically my character has two states:

  • `State A: RigidBody2D mode is set to CHARACTER and the circle collision shape is active.
  • State B: RigidBody2D mode is set to RIGID and the circle collision shape is disabled.
func change_mode(new_mode):
    match new_mode:
        STATE_MODES.OBJECT:
            state_mode = STATE_MODES.OBJECT
            set_deferred("mode",  RigidBody2D.MODE_RIGID)
            $motion_collider.set_deferred("disabled", true)
        STATE_MODES.CHARACTER:
            state_mode = STATE_MODES.CHARACTER
            set_deferred("mode", RigidBody2D.MODE_CHARACTER)
            $motion_collider.set_deferred("disabled", false)
func _integrate_forces(state):    
    if Input.is_action_just_pressed("ui_select"):
        change_mode(STATE_MODES.OBJECT)
    if Input.is_action_just_released("ui_select"):
        change_mode(STATE_MODES.CHARACTER)

Its more easy to see than explain it, so I recorded the glitch / bug:
https://discordapp.com/channels/212250894228652034/610347507222052867/702744596421148733

Was this page helpful?
0 / 5 - 0 ratings