From 359d7f178c9c64365355db10fa41492c903558b9 Mon Sep 17 00:00:00 2001 From: Colin Redman <20376935+credman0@users.noreply.github.com> Date: Sat, 4 May 2019 10:08:49 -0700 Subject: [PATCH] Fix ParallaxBackground breaking when moving it out the scene tree --- scene/2d/parallax_layer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index baf5b5967b2..9a6b63b9a34 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -105,6 +105,11 @@ void ParallaxLayer::_notification(int p_what) { orig_scale = get_scale(); _update_mirroring(); } break; + case NOTIFICATION_EXIT_TREE: { + + set_position(orig_offset); + set_scale(orig_scale); + } break; } }