set_position() being ignored on a RigidBody2D node

:bust_in_silhouette: Reply From: eons

Rigid bodies are not meant to be moved manually but by the physics engine, the node position will be reset by the engine to the correct values according the data of the body physics state.

If you need to “teleport” a rigid body (which should be an exception), you can modify the transform’s origin of the body state.

The callback _integrate_forces gives you easy access to the state and can be used for that kind of operations (you can get the state via Physics2DServer too).

I wanted to pick up a rock(RigidBody2D)…i tried using the position property to place it my my characters hand ,but doesn’t work…How could i implement _integrate_forces on this?

Yoseph | 2019-08-13 06:29