0 votes

Can joint2d connect two nodes, which have multiple children in them?

in Engine by (341 points)

1 Answer

+1 vote

Yes, it can. Have you tried it?

by (19,298 points)

yeah, I try to connect two nodes. One has several rigidbody2d and Pinjoint2d, and the other one has a kinematicbody2d. I put these two nodes into one scene, and add a pinjoint2d to the scene. I try to use the inspector to choose the nodea and nodeb, however, these two nodes are gray and not chosen able. Then, I try to use the script to connect them, but the result is they still go like two separate objects.
Is there any good solution for this problem?
and, thanks for the answer.

The nodes you assign to the joints must extend from PhysicsBody2D, so any of KinematicBody2D, RigidBody2D, or StaticBody2D. Those nodes can have children as necessary. Nodes that are grayed out when you attempt to assign them to the joint (I assume) do not extend from PhysicsBody2D.

Here's a good overview and an example project...

https://kidscancode.org/godot_recipes/physics/joints_2d/

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.