From 7741afb55a3ad5a11097ff723e8bee4f69ba13d1 Mon Sep 17 00:00:00 2001 From: SeleckyErik <35656626+SeleckyErik@users.noreply.github.com> Date: Wed, 1 Sep 2021 14:57:14 +0200 Subject: Fix ParallaxLayer's transform resetting in editor Disable resetting of ParallaxLayer's position and scale in editor to allow setting the initial values. --- scene/2d/parallax_layer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index 1fe6a4a4b8..67e35cc7a3 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -100,6 +100,10 @@ void ParallaxLayer::_notification(int p_what) { _update_mirroring(); } break; case NOTIFICATION_EXIT_TREE: { + if (Engine::get_singleton()->is_editor_hint()) { + break; + } + set_position(orig_offset); set_scale(orig_scale); } break; -- cgit v1.2.3