diff options
-rw-r--r-- | scene/2d/collision_object_2d.cpp | 10 | ||||
-rw-r--r-- | scene/2d/collision_object_2d.h | 1 |
2 files changed, 3 insertions, 8 deletions
diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index 228b67990c..9f79691405 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -46,8 +46,6 @@ void CollisionObject2D::_notification(int p_what) { else Physics2DServer::get_singleton()->body_set_state(rid, Physics2DServer::BODY_STATE_TRANSFORM, global_transform); - last_transform = global_transform; - RID space = get_world_2d()->get_space(); if (area) { Physics2DServer::get_singleton()->area_set_space(rid, space); @@ -73,19 +71,17 @@ void CollisionObject2D::_notification(int p_what) { } break; case NOTIFICATION_TRANSFORM_CHANGED: { - Transform2D global_transform = get_global_transform(); - - if (only_update_transform_changes && global_transform == last_transform) { + if (only_update_transform_changes) { return; } + Transform2D global_transform = get_global_transform(); + if (area) Physics2DServer::get_singleton()->area_set_transform(rid, global_transform); else Physics2DServer::get_singleton()->body_set_state(rid, Physics2DServer::BODY_STATE_TRANSFORM, global_transform); - last_transform = global_transform; - } break; case NOTIFICATION_EXIT_TREE: { diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h index 4e7d01c8e6..0a9d33b8a6 100644 --- a/scene/2d/collision_object_2d.h +++ b/scene/2d/collision_object_2d.h @@ -67,7 +67,6 @@ class CollisionObject2D : public Node2D { int total_subshapes; Map<uint32_t, ShapeData> shapes; - Transform2D last_transform; bool only_update_transform_changes; //this is used for sync physics in KinematicBody protected: |