Browse Source

Fixed error in ParallaxLayer when set_mirroring is called before entering the tree

Fixes #31300
PouleyKetchoupp 6 years ago
parent
commit
927a7916f6
1 changed files with 3 additions and 0 deletions
  1. 3 0
      scene/2d/parallax_layer.cpp

+ 3 - 0
scene/2d/parallax_layer.cpp

@@ -69,6 +69,9 @@ Size2 ParallaxLayer::get_motion_offset() const {
 
 
 void ParallaxLayer::_update_mirroring() {
 void ParallaxLayer::_update_mirroring() {
 
 
+	if (!is_inside_tree())
+		return;
+
 	ParallaxBackground *pb = Object::cast_to<ParallaxBackground>(get_parent());
 	ParallaxBackground *pb = Object::cast_to<ParallaxBackground>(get_parent());
 	if (pb) {
 	if (pb) {