I want to load a glb file (3D character) and display it on the game screen. The basic workflow is as follows, and it works fine.
pub fn born(
mut commands: Commands,
asset_server: Res<AssetServer>,
mut query: Query<(Entity, &WillBeBorn)>,
) {
for (entity, _) in query.iter_mut() {
let scene: Handle<Scene> = asset_server.load(format!("{}#Scene0", GLB_FILE_NAME));
let mut entity_commands = commands.entity(entity);
entity_commands.insert(PbrBundle { ..default() });
// Add Scene
entity_commands.with_children(|parent| {
parent
.spawn(SceneBundle {
scene: scene.clone(),
..default()
})
.insert(TargetScene);
});
}
}
However, I would like to dynamically hide a specific GltfMesh (for example, hair) from this displayed character.
How can this be achieved?