godotengine/godot

Physics2DServer.body_set_state() Not setting state immediately

Piet-G opened this issue · 2 comments

Godot version:
3.0.3

Issue description:
When the state of a KinematicBody2D is set using Physics2DServer.body_set_state() it is not updated immediately, when called Physics2DServer.body_get_state() still returns the old state. It seems to only be updated the next physics frame.

Steps to reproduce:

Set state of KinematicBody2D using the physics server and then request the current state.

Minimal reproduction project:

Physics2DTest.zip

Press the button, it will set the state and print whether it is equal to the value it was set to.

eon-s commented

Modifying the transform of the result of body_get_direct_state also do not work, if this is not possible then Kinematic Bodies will need a safe method for warping it around the screen.

Still valid in 4e52c75, although it should be probably just mentioned in docs.