You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there, been playing with bevy-parallax today and ran into a problem: I can't manage to remove the parallax!
This may be me being awful at Bevy and not a problem with the library itself, so if that's the case I apologize in advance.
My setup has different game states (Menu, Game), and I only want the parallax drawn when I'm in Game state. I only have one camera for the various states, so I can't simply throw away the camera entirely like some of the examples in this repository do to reset the parallax.
Here's how I'm initializing it:
fn initialize_parallax(mutcommands:Commands,mutcreate_parallax:EventWriter<CreateParallaxEvent>,camera_query:Query<Entity,With<MainCamera>>,){let camera = camera_query.get_single().expect("Camera not found");
commands.entity(camera).insert(ParallaxCameraComponent::default());
create_parallax.send(CreateParallaxEvent{// ... the layers_data,
camera
});
I tried to remove the ParallaxCameraComponent from the camera when leaving the Game game state, but that isn't working:
Hey there, been playing with
bevy-parallax
today and ran into a problem: I can't manage to remove the parallax!This may be me being awful at Bevy and not a problem with the library itself, so if that's the case I apologize in advance.
My setup has different game states (
Menu
,Game
), and I only want the parallax drawn when I'm inGame
state. I only have one camera for the various states, so I can't simply throw away the camera entirely like some of the examples in this repository do to reset the parallax.Here's how I'm initializing it:
I tried to remove the
ParallaxCameraComponent
from the camera when leaving theGame
game state, but that isn't working:Is this a valid use case for
bevy-parallax
adding some sort of remove/despawn command added in future versions, or am I just doing it wrong?The text was updated successfully, but these errors were encountered: