diff --git a/content/system/room/room.gd b/content/system/room/room.gd index d744f7a..9f441d6 100644 --- a/content/system/room/room.gd +++ b/content/system/room/room.gd @@ -36,6 +36,10 @@ func _start_edit_mode(): wall_corners.visible = true wall_edges.visible = true wall_mesh.visible = false + wall_mesh.mesh = null + + for old_coll in wall_collisions.get_children(): + old_coll.queue_free() func _end_edit_mode(): wall_corners.visible = false @@ -47,9 +51,6 @@ func _end_edit_mode(): var collisions = generate_collision(wall_mesh.mesh) - for old_coll in wall_collisions.get_children(): - old_coll.queue_free() - for collision in collisions: var static_body = StaticBody3D.new() static_body.set_collision_layer_value(4, true)