I’m trying to get a RigidBody’s PhysicsDirectBodyState, and to do that I wanted to try to use PhysicServer.body_get_direct_state(body: RID), but to do that, I first have to get the RigidBody’s RID. How can I do that?
Thanks in advance!
void _integrate_forces(state: PhysicsDirectBodyState2D) virtual
Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the custom_integrator property allows you to disable the standard force integration and do fully custom force integration for a body.
You can put the _integrate_forces(state) function in your script just like the _ready() function and it will work as described above (at the end of every frame)