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

Modify Particle Spawner Count Over Time #373

Closed
morgenthum opened this issue Aug 26, 2024 · 3 comments
Closed

Modify Particle Spawner Count Over Time #373

morgenthum opened this issue Aug 26, 2024 · 3 comments

Comments

@morgenthum
Copy link

Hi there!

I created a rain particle effect, but I want to dynamically adjust the spawner count over time so that the rain gradually starts and stops. I attempted to implement this with the following code, but it doesn’t seem to have any effect:

fn update_effect_count(
    mut effects: ResMut<Assets<EffectAsset>>,
    effect_query: Query<&ParticleEffect>,
) {
    for effect in effect_query.iter() {
        let effect_asset = effects.get_mut(&effect.handle).unwrap();
        effect_asset.spawner.set_count(1.0.into());
    }
}

Could someone point out what I might be doing wrong or suggest an alternative approach?

@djeedai
Copy link
Owner

djeedai commented Aug 26, 2024

Isn't this the same as #371 ?

@morgenthum
Copy link
Author

Oh yes, exactly!

@djeedai
Copy link
Owner

djeedai commented Aug 27, 2024

Closing as duplicate of #371

@djeedai djeedai closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@djeedai @morgenthum and others