0 votes

Alright guys so what I want to do is that I have created a lethal cauldron in my game from which particles emit. But I want the particles to come out after every 2 Seconds. How can I achieve that ?

in Projects by (359 points)

1 Answer

0 votes
Best answer

One way would be to set the lifetime property to for example 2 seconds and increase the explosiveness parameter to force the particles to all go out together.
Another way is with a Timer:
Set the one_shot property of the particle to on. Then from code you can use the emitting property to turn on the particles. Every time you use for example $ particle2D.emitting = true the particles will start. When one_shot is activating, they will turn off when they complete their lifetime. You can use a Timer or any other event to trigger this.
Edit:
I forgot to mention how to use the Timer node: Add a Timer node to your scene, set the desired time to wait_time property and autostart to on. Go to the node tab where the signals are and connect the timeout signal to your script:

func _on_Timer_timeout():
    $Particles2D.emitting=true
by (1,712 points)
selected by
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.

Categories