From ce65022905c48e21c52530ee98bad9adc62c7f31 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 23 Apr 2024 03:49:47 +0200 Subject: [PATCH] despawn skeleton limbs on player death --- src/skeleton.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/skeleton.rs b/src/skeleton.rs index 9989c59..99b03e1 100644 --- a/src/skeleton.rs +++ b/src/skeleton.rs @@ -8,6 +8,7 @@ // + + + ███ // + ▀████████████████████████████████████████████████████▀ +use crate::world; use bevy::ecs::system::EntityCommands; use bevy::prelude::*; @@ -168,6 +169,7 @@ pub fn load( parent.spawn(( Limb::Base, Animation::HumanFloat, + world::DespawnOnPlayerDeath, SceneBundle { scene: load_scene_by_path(human.base.as_str(), asset_server), ..default() @@ -182,6 +184,7 @@ pub fn load( let mut parent_limb = parent.spawn(( limb.class, Animation::HumanFloat, + world::DespawnOnPlayerDeath, SceneBundle { scene: load_scene_by_path(limb.path.as_str(), asset_server), transform: Transform::from_translation(limb.pos).with_rotation(rot), @@ -202,6 +205,7 @@ pub fn load( let mut entity_commands = parent.spawn(( child_limb.class, Animation::HumanFloat, + world::DespawnOnPlayerDeath, SceneBundle { scene: load_scene_by_path(child_limb.path.as_str(), asset_server), transform: Transform::from_translation(child_limb.pos).with_rotation(rot),