How to instance a scene behind other?

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

hi, I Have a player who instance a bullet with a position2d node, but I need the bullet spawn behind the player, I found a property “show behind parent” but I activate that and bullet keep spawning ahead

:bust_in_silhouette: Reply From: caprinae

Have you tried setting the z-index on your player and your bullet nodes? This way you can ensure they will always be drawn in the order that you want. A node with a lower z-index will be drawn under a node with a higher z-index.

thanks that work!

Pelli | 2020-04-17 20:05

:bust_in_silhouette: Reply From: Magso

Set the z_index property of the bullet is lower than the player, or if it’s a child of the player and z_as_relative is true set it below 0, similar to 3D with the camera’s projection set to orthogonal facing in the -Z direction.