The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

+10 votes


I want to switch the behaviour of a Rigidbody2d node from kinematic to rigid and vice versa. Currently I am trying out 3.1 beta2.

What confuses me however, is how to properly move the rigidbody, when in kinematic mode. What i find is, that i should be altering the position directly, which is what is stated one should not do, reading from the documentation.

After debugging the behavior of the body. I found that It looks like, once in kinematic mode, the body's state is forced set to sleeping (though cansleep is false), and the _integrateforces function is not called. Applying forces or impulse won't move the body, so altering the position(setposition/setglobal_position) is all that's left. And once I do that, integrate is called, the body moves and is interacting with other bodies in the scene.

According to the latest doc, it should behave like the KinematicBody2d, but in the rigidbody class, we don't have access to the "move_*" functions , which is the recommended way to use that node type.

in Engine by (22 points)

Please log in or register to answer this question.

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.