godot-box2d icon indicating copy to clipboard operation
godot-box2d copied to clipboard

PinJoint2D has an odd "self stabalizing" behavior.

Open SirLich opened this issue 1 year ago • 4 comments

Describe the bug When using a PinJoin2D to connect two Rigid Bodies, Box2D will "self stabilize" in a way that's inconsistent with Godot Physics.

To Reproduce Steps to reproduce the behavior:

  1. Download example project
  2. Press 'Play'. You can view the unicycle crash to the ground (Godot Physics)
  3. Change physics to Box2D (included in the project already)
  4. Press 'Play'. You can view the unicycle self-stabilize itself, and drive around the test area.

Box2D:

image

Godot:

image

Expected behavior While somewhat novel, I expect the Box2D PinJoin2D to function more similarly to Godot Physics.

Project uni.zip

Versions (please complete the following information):

  • OS: Windows
  • Godot 4.2.1-stable
  • Box2d 0.9.9 (from plugin.cfg)

SirLich avatar Feb 04 '24 20:02 SirLich

Note: I've tried Rapier, and it actually works!

SirLich avatar Feb 04 '24 20:02 SirLich

Interesting. I wonder if the angle limits are enabled even if the flag is off. I'll investigate and see.

Ughuuu avatar Feb 05 '24 10:02 Ughuuu

@Ughuuu setting the flat to True and then fiddling with the lower and upper angles doesn't appear to have any (or at least the desired) effect.

if I turn it on, and leave the angles at '0', it yeets itself into non-existance as soon as the wheel hits the ground.

SirLich avatar Feb 05 '24 17:02 SirLich

Turning the 'moter' on is fine, until the seat hits the ground, then it yeets itself as well.

SirLich avatar Feb 05 '24 17:02 SirLich