Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Physics2DServer.body_set_state() Not setting state immediately #20107

Closed
Piet-G opened this issue Jul 11, 2018 · 2 comments · Fixed by #41423
Closed

Physics2DServer.body_set_state() Not setting state immediately #20107

Piet-G opened this issue Jul 11, 2018 · 2 comments · Fixed by #41423

Comments

@Piet-G
Copy link
Contributor

Piet-G commented Jul 11, 2018

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
Copy link
Contributor

eon-s commented Jul 12, 2018

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.

@KoBeWi
Copy link
Member

KoBeWi commented Aug 20, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants