0 votes

my game require many sprites laying on top of each other but is there a way to control which sprite is on top of which and change its visibility layers thx

in Engine by (41 points)

1 Answer

0 votes

You can control which sprite is "on top" via its z_index property. Higher values will be drawn on top of lower values...

$Sprite.z_index = 10

Additionally, you can control the visibility of a given sprite its visible property. For example:

$Sprite.visible = false
by (12,477 points)
edited by

If I have a Singleton / Autoload and want it to lay on top of my background , what to do , as z-index is not working ?

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.