diff --git a/crates/bevy_state/src/state_scoped.rs b/crates/bevy_state/src/state_scoped.rs index 3e9f49f517..02a8c75cdc 100644 --- a/crates/bevy_state/src/state_scoped.rs +++ b/crates/bevy_state/src/state_scoped.rs @@ -60,6 +60,15 @@ use crate::state::{StateTransitionEvent, States}; #[cfg_attr(feature = "bevy_reflect", derive(Reflect), reflect(Component))] pub struct StateScoped(pub S); +impl Default for StateScoped +where + S: States + Default, +{ + fn default() -> Self { + Self(S::default()) + } +} + /// Removes entities marked with [`StateScoped`] /// when their state no longer matches the world state. ///