How to solve the problem of sprite rendering order? #4491
Locked
PoisonousGame
started this conversation in
2D
Replies: 1 comment
-
Duplicate of godotengine/godot#60748. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How to solve the problem of sprite rendering order?



The sword and shield are separated into two sprites, and I need to change the order in which they are displayed in the animation. If I use z_index, the following problem will occur. Sword and shield are hidden behind trees. Since I need Ysort to sort according to the Y coordinate, and I want the sword and shield to only be rendered and sorted relative to the inside of the character, and they are at the same z-index for the outside, how to solve this problem?
The character (KinematicBody2D3) has 3 sprites, two of which are sword and shield. The sword and shield are located behind the cha sprite at the beginning. I want to play the sword drawing animation, and the sword sprite is located in front of the cha sprite. This effect can be achieved with z_index. However, when the character is placed on the map and moved, due to the z_index rendering problem, the sword and shield are hidden behind the tree.
Beta Was this translation helpful? Give feedback.
All reactions