Browse Source

Fix ParallaxBackground breaking when moving it out the scene tree

Colin Redman 6 years ago
parent
commit
359d7f178c
1 changed files with 5 additions and 0 deletions
  1. 5 0
      scene/2d/parallax_layer.cpp

+ 5 - 0
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;
 	}
 }