You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
Merge pull request #72665 from KoBeWi/sneaky_ParallaxBackground_destroys_the_world
Fix Camera2D crash due to ParallaxBackground node
This commit is contained in:
@@ -1062,6 +1062,10 @@ void Viewport::assign_next_enabled_camera_2d(const StringName &p_camera_group) {
|
||||
Camera2D *new_camera = nullptr;
|
||||
for (Node *E : camera_list) {
|
||||
Camera2D *cam = Object::cast_to<Camera2D>(E);
|
||||
if (!cam) {
|
||||
continue; // Non-camera node (e.g. ParallaxBackground).
|
||||
}
|
||||
|
||||
if (cam->is_enabled()) {
|
||||
new_camera = cam;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user