Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rigid bodies disconnect from joints frequently when exclude_nodes is on #45145

Closed
ator-dev opened this issue Jan 12, 2021 · 4 comments · Fixed by #45159
Closed

Rigid bodies disconnect from joints frequently when exclude_nodes is on #45145

ator-dev opened this issue Jan 12, 2021 · 4 comments · Fixed by #45159

Comments

@ator-dev
Copy link
Contributor

ator-dev commented Jan 12, 2021

Godot version:
3.2.4 beta 5

OS/device including version:
Ubuntu 20.04 LTS

Issue description:
As of this beta release, whenever a rigid body is moved, collision shapes are added/removed from it or collision shapes are moved within it (i.e. collision data changes in any way) - the body disconnects from any joints connected to it. The node paths in the joints do not change, but the node no longer has any effect on the physics simulation. In order to get this working again, at least one of the node paths (via set_node_a() or set_node_b()) must be set to @"." or some other irrelevant value, then set back so it's pointing to the correct body again.

I was using 3.2.4 beta 3 earlier, and that version of the engine had no problem with physics bodies or collision data being changed at runtime and would not disconnect any joints from doing so.

After doing some more investigating (and writing most of the above message), I thankfully discovered that the issue only occurs when the property exclude_nodes is set to true, so I do have a way of continuing my game in the meantime. The problem coincides exactly with the following warning message:

WARNING: remove_rigid_body: A body connected to joints was removed. Ensure bodies are disconnected from joints before removing them. At: modules/bullet/space_bullet.cpp:505.

Steps to reproduce:

  1. Set up a scene roughly similar to my minimal reproduction project:
    • One rigid body containing a mesh and a collision shape should be present
    • One joint (e.g. hinge) should have node_b set to this body and node_a blank
    • Before playing the scene, turning the joint exclude_nodes property ON should result in the behaviour I described when playing; turning it OFF should result in the normal expected behaviour
  2. Play the scene and open the remote tree; try setting the transform of the collision shape to a different value, or changing the scale of the body, and see whether the body continues hanging or falls into the void (corresponds with the warning message detailed above).

Minimal reproduction project:
joint_disconnect_example.zip

Note - I've never posted an issue on GitHub before, so I'm uncertain about a few things such as what the title should be. Please correct me if I didn't do this right.

@Calinou
Copy link
Member

Calinou commented Jan 12, 2021

Can you reproduce this bug in 3.2.4 beta 4?

cc @madmiraal

@ator-dev
Copy link
Contributor Author

ator-dev commented Jan 12, 2021

Thanks, just checked and it seems to work fine in beta 4 (based on the minimal reproduction project).
Edit: to clarify, it works fine as in the warning doesn't appear and the bodies remain attached.

@madmiraal
Copy link
Contributor

This is a regression from #43899.

@ator-dev
Copy link
Contributor Author

Thank you for your help! Hope this report was useful - again, I've never opened an issue before so wasn't sure how to go about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants