summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-11-21 22:22:43 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-11-21 22:22:43 -0300
commit0032345618ae5dd68c1b054e114e292b4fcf6f4b (patch)
treef3d848242be9a5e1cd02244fcbac3b0cea753ac9 /scene/2d
parenta2a606794c7d29452a59eee1eab07213827654a0 (diff)
Make sure sync to physics is disabled in editor, fixes #20230
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/physics_body_2d.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index 929b4624ee..3dde228bfa 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -1425,6 +1425,10 @@ void KinematicBody2D::set_sync_to_physics(bool p_enable) {
return;
}
sync_to_physics = p_enable;
+
+ if (Engine::get_singleton()->is_editor_hint())
+ return;
+
if (p_enable) {
Physics2DServer::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
set_only_update_transform_changes(true);