Hi, the problem is that zIndex of the characters are defined by their spawn order in the map. So for example if I spawn character A and B in this order, B will always be over A.
Will it be possible that the zIndex is calculated with the y position of the sprite in he map without looping on every spawned characters on the map ?
You can see the problem in the screenshot below
Edit: To be exact, the “A” zIndex have to change whenever the gameObject y
is below or above the gameObject “B” so that, in the screenshot the girl should be below the guy but only when her y
is above the other character y