diff options
author | Juan Linietsky <juan@godotengine.org> | 2019-03-04 09:42:00 -0300 |
---|---|---|
committer | Juan Linietsky <juan@godotengine.org> | 2019-03-04 09:53:02 -0300 |
commit | 4f041d3afaf8308f51f1894f75193ea8740d4ff6 (patch) | |
tree | 57ffd3a4c49f146af14de305c4423f972427646b | |
parent | 813d32499a85597aa4ea4191b749fcee7ace3073 (diff) |
Specifically error when users try to use sync to physics and move and slide, closes #26545
-rw-r--r-- | scene/2d/physics_body_2d.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index eeabe15b08..1b7e1a6b8b 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -1198,6 +1198,9 @@ bool KinematicBody2D::separate_raycast_shapes(bool p_infinite_inertia, Collision bool KinematicBody2D::move_and_collide(const Vector2 &p_motion, bool p_infinite_inertia, Collision &r_collision, bool p_exclude_raycast_shapes, bool p_test_only) { + if (sync_to_physics) { + ERR_PRINT("Functions move_and_slide and move_and_collide do not work together with 'sync to physics' option. Please read the documentation."); + } Transform2D gt = get_global_transform(); Physics2DServer::MotionResult result; bool colliding = Physics2DServer::get_singleton()->body_test_motion(get_rid(), gt, p_motion, p_infinite_inertia, margin, &result, p_exclude_raycast_shapes); |