From 927a7916f659d5ddf845f02d802f7c8890824246 Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Tue, 13 Aug 2019 20:59:41 +0200 Subject: [PATCH] Fixed error in ParallaxLayer when set_mirroring is called before entering the tree Fixes #31300 --- scene/2d/parallax_layer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index 9a6b63b9a34..0823e09110d 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -69,6 +69,9 @@ Size2 ParallaxLayer::get_motion_offset() const { void ParallaxLayer::_update_mirroring() { + if (!is_inside_tree()) + return; + ParallaxBackground *pb = Object::cast_to(get_parent()); if (pb) {