summaryrefslogtreecommitdiff
path: root/scene/2d
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2019-08-13 20:59:41 +0200
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2019-08-14 13:21:22 +0200
commit927a7916f659d5ddf845f02d802f7c8890824246 (patch)
tree33ac3b9a7428c24e7f49b5c1f3c8f8d9eb6e48a7 /scene/2d
parent839cc98cb9d65bd80f50a7f981350966fedc54ee (diff)
Fixed error in ParallaxLayer when set_mirroring is called before entering the tree
Fixes #31300
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/parallax_layer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp
index 9a6b63b9a3..0823e09110 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<ParallaxBackground>(get_parent());
if (pb) {