How to instance an particle with a specif draw layer

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

I just want to instance a flash particle behind my player, I tried searching but no success

this is the code im using to spawn it but it aways spawn on top of my player

func shoot(event):
if Input.is_mouse_button_pressed(BUTTON_LEFT):
	var bulletanim = BULLET.instance()
	get_parent().add_child(bulletanim)
	bulletanim.position = spawn_position.global_position
	bulletanim.look_at(get_global_mouse_position())
:bust_in_silhouette: Reply From: Adam_S

You can control the order in which nodes render by changing its Z-index property.
A node with a higher Z-index will display in front of others.
So you will have to increase it on the player or reduce it on the particles.