From ada54450a5bf92e9b5cca606576a384e03d62e44 Mon Sep 17 00:00:00 2001 From: Jan Hohenheim Date: Thu, 21 Mar 2024 21:31:35 +0100 Subject: [PATCH] fix(bevy_gltf_blueprints): fix occasional crash (#168) * Fixes #156 * Fix post processing not affecting visibility of entities --- crates/bevy_gltf_blueprints/src/lib.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/bevy_gltf_blueprints/src/lib.rs b/crates/bevy_gltf_blueprints/src/lib.rs index 78642cd..36ac25b 100644 --- a/crates/bevy_gltf_blueprints/src/lib.rs +++ b/crates/bevy_gltf_blueprints/src/lib.rs @@ -19,7 +19,11 @@ pub use copy_components::*; use core::fmt; use std::path::PathBuf; -use bevy::{prelude::*, render::primitives::Aabb, utils::HashMap}; +use bevy::{ + prelude::*, + render::{primitives::Aabb, view::VisibilitySystems}, + utils::HashMap, +}; use bevy_gltf_components::{ComponentsFromGltfPlugin, GltfComponentsSet}; #[derive(SystemSet, Debug, Hash, PartialEq, Eq, Clone)] @@ -166,10 +170,11 @@ impl Plugin for BlueprintsPlugin { .in_set(GltfBlueprintsSet::Spawn), ) .add_systems( - Update, + PostUpdate, (spawned_blueprint_post_process, apply_deferred) .chain() - .in_set(GltfBlueprintsSet::AfterSpawn), + .in_set(GltfBlueprintsSet::AfterSpawn) + .before(VisibilitySystems::CheckVisibility), ); } }