Fix: Make shipwreck sound entity despawn itself

I started to work on weapon fire sounds and realized I don't know if the
entity and/or component get removed after playback ends. It turns out
that they DO NOT!... unless told to do so, like this.
This commit is contained in:
2025-12-17 14:23:57 -06:00
parent b1fd2e5f73
commit 3963b548b9

View File

@@ -237,7 +237,7 @@ pub fn ship_impact_listener(
// STEP 5: Play crash sound
commands.spawn((
AudioPlayer::new(game_assets.wreck_sound()),
PlaybackSettings::ONCE,
PlaybackSettings::DESPAWN, // despawn this entity when playback ends.
));
}
}