Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated spawner is ignored when changing EffectAsset on already spawned FX entity #371

Open
VergilUa opened this issue Aug 17, 2024 · 0 comments
Labels
A - components Change related to an ECS component C - bug Something isn't working

Comments

@VergilUa
Copy link

VergilUa commented Aug 17, 2024

Crate versions
bevy version: 0.13.2
bevy_hanabi version: 0.11

Describe the bug
When changing EffectAsset inside ParticleEffect component - new spawner settings / behavior are being ignored.
This is useful for the "editor" case, where FX behavior should be possible to modify without destroying / recreating entity completely.

Expected behavior
Either changes to the FX should be propagated automatically (and FX should restart), or a way to trigger spawner behavior change should be provided.

To Reproduce

  • Spawn an FX with ParticleEffectBundle (e.g., with Spawner::rate);
  • Set ParticleEffect component with EntityCommands.insert(...) with a different spawner setup (e.g, with Spawner::burst) / EffectAsset;

As a workaround, setting EffectSpawner component separately works. E.g., with EffectSpawner::new(EffectAsset).
But that requires an extra copy of EffectAsset to be stored alongside user data or a direct access to the Assets<EffectAsset> to be used. It would be much more convenient to have a built-in system to update the spawner on change based on some dirty flag.

@djeedai djeedai added A - components Change related to an ECS component C - bug Something isn't working labels Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A - components Change related to an ECS component C - bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants