0 votes

In my new game i am using particles to represent stars in the background that quickly move downward to represent you moving forward in space, similarly (in fact, pretty much the same) to galaga. I have it working but there are a couple things that i want. Firstly, is there a way to terminate the particle when it reaches the end of the screen? My particles have varying speeds at random so i can't really just set an exact time. And secondly, is there a way to spawn particles immediately? I want the particles to spawn at the top of the screen and go down, but this means that upon starting the game it takes time for the particles to actually show up on the whole screen, so is there a way to randomly make a few first? Thanks for your help!

in Engine by (241 points)
reshown by

1 Answer

0 votes
Best answer

Is there a way to terminate the particle when it reaches the end of the screen?

There is not (as far as I know) a way in Godot 3 to designate an area so that all particles that enter it are deleted. Is there a specific reason you want to remove them as soon as they're offscreen? You might try setting an absurdly long lifespan and seeing if there's any adverse effects.

secondly, is there a way to spawn particles immediately?

Yes! You're looking for the preprocess parameter in the Time section of the Particles2D Node. I think that'll do what you're looking for.

by (629 points)
selected by

Thank you! I just want to terminate them then because it would save some unnecessary particles, but it doesn't make a big difference anyway

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.