Can't start particles system via script

Godot Version

4.2.2

Question

I’m using the particles system to simulate a meteorite shower and I want it to start emitting at a certain point in the story. I use @onready var comets = $Comets in the beginning and comets.emitting = true where I want it to start. I know (think?) it’s in the right place because if I test it with print(comets.emitting) just after it prints true… but it doesn’t do anything (neither visually in the game window nor in the editor - “Emitting” is still disabled even after I told it to emit). Am I missing something?

You’re doing it right, setting emitting to true should do it.
Make sure the visibility_aabb is on screen, otherwise the particles won’t be rendered, even if they’re supposed to enter the screen.

Thank you for your answer! I had checked the visibility before but what I didn’t notice is… I had turned off the parent’s visibility!
Anyway, problem solved, thanks.

1 Like