Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Korsut |
Can Sprite2 be located on top of Sprite3, without changing nodes, with this architecture?
Node2D
-Sprite
–Sprite2
-Sprite3
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Korsut |
Can Sprite2 be located on top of Sprite3, without changing nodes, with this architecture?
Node2D
-Sprite
–Sprite2
-Sprite3
Reply From: | DDoop |
If I’m reading your question right, you want a Sprite graphically on top of another regardless of the order in the scene tree. To do that, set the z-index for the one you want to be on top to be larger than the z-index of the Sprite on the bottom.
All nodes that inherit from Node2D have a z_index
property.
Reply From: | jgodfrey |
Sure. Just set the z_index
of Sprite2 to a larger value than Sprite3 (either directly in the inspector or through code).