+1 vote

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

in Engine by (126 points)

2 Answers

+1 vote
Best answer

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.

by (266 points)
selected by

thanks that work!

+1 vote

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.

by (3,223 points)
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.