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

First spawn of a ParticleEffectBundle with a "once" spawner does not emit particles #319

Open
Jaso333 opened this issue Apr 24, 2024 · 3 comments
Labels
C - bug Something isn't working

Comments

@Jaso333
Copy link

Jaso333 commented Apr 24, 2024

Crate versions
bevy version: 0.13.2
bevy_hanabi version: 0.10.0

Describe the bug
When spawning an entity with a particle effect that is configured with Spawner::once and starts_immediately set to true, it does not emit any particles. However, it does happen the second time an entity of the exact same configuration is spawned.

Expected behavior
The first time the entity is spawned with the above configuration, particles should emit.

To Reproduce

  1. Insert a resource containing an effect asset that uses a "once" spawner with starts_immediately set to true. This happens in a Startup system.
  2. In an Update system that runs if an event is received, a ParticleEffectBundle is spawned in a new entity, which references the effect asset created earlier.
  3. Trigger the event once, no particles are emitted from the spawned entity.
  4. Trigger the event a second time and the particles are correctly emited from the second spawned entity.

An minimal reproducable example of this happening can be shown here: https://github.com/Jaso333/hanabi-issue

Screenshots
N/A

@djeedai djeedai added the C - bug Something isn't working label Apr 24, 2024
@djeedai
Copy link
Owner

djeedai commented Apr 24, 2024

Thanks for the repro, I will have a look.

@djeedai
Copy link
Owner

djeedai commented May 19, 2024

I just tested and this works on main with latest changes. There were a bunch of bug fixes recently so I assume this was fixed among them. Closing for now, please feel free to re-open if there's still an issue. Thanks!

@djeedai djeedai closed this as completed May 19, 2024
@PraxTube
Copy link

PraxTube commented Jan 8, 2025

I am still seeing this behaviour on 0.14 (with bevy 0.15.1). I have the same setup (a resource with a handle to an EffectAsset and spawning the effect multiple times at runtime). However the first effect is never visible.

I can reproduce the issue with the firework example on main. This is how it looks. The first burst is not right. If I were to use once instead of burst then I would only see the buggy one.

firework.mp4

In my game it seems like the first effect isn't spawning at all, however that is not the case (and I am assuming the same is true for the original bug report). The effect is indeed spawned, however the first burst is just buggy and not really visible, which leads to the conclusion it's not spawned (I changed the once to a burst and you can see that the first burst of the first effect is "missing").

game.mp4

@djeedai djeedai reopened this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants