Problem with particles2D.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By smetek

Hi! lately i fully complete an player with animations, So now i wanted to add “effects” to it like dust when he jump. I made it with particles2d but the problem is that sometimes it doesn’t emit the “dust”. I notice that its something with life_time because when i set it to 0.1 its working well.

Here’s some information about particle and player script i use.

Particles2D:

Life_time = 0,4
One_shot = on
Explosivenes = 1
Local Coords = false
and other options like color, scale but i don’t think it matters.

Player script:

if Input.is_action_just_pressed("Jump"):
	$Jumpeffect.emitting = true
:bust_in_silhouette: Reply From: estebanmolca

Hi, I tried the same way and I had the same problem, look at the documentation in the editor and particles has a restart method, this method works instantly but removes any previous particles.

if Input.is_action_just_pressed("Jump"):
	$Particles2D.restart()

Thanks it works well!

smetek | 2021-03-06 09:19