How does one safely move a RigidBody2D with others attached to it with joints?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Exxion

I’m aware of how to safely move a single RigidBody2D through _integrate_forces(), but how do you do this correctly when the body is attached to another with a joint? Directly setting the second body’s position obviously doesn’t work, but neither does changing its Physics2DDirectBodyState, either inside its _integrate_forces() or outside it. The only solution I’ve found is to parent the second body to the first and set it to MODE_STATIC for one frame. This works, but means the second object doesn’t move for a frame. Is there a way to do this seamlessly, or is freezing the second object like that required?