E
E
Emil2019-02-26 02:27:15
C++ / C#
Emil, 2019-02-26 02:27:15

How to set the display order of objects on the stage?

Hello everyone, please tell me how to set the display order of each individual object, so that this does not happen? TeLxh8kFp9w.jpg
Each object has such a set lD5Oe24uEKE.jpg
. Each has its own layer order, and when spawning, it turns out that the character standing behind is visible.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Gaydak, 2019-02-26
@DyadyaEmil

you don’t get 2D here, but more like 2.5D or isometric)
you can try to google how it is solved there.
usually something in the spirit of a script, which, depending on the range (and in your case, the higher), is changed just OrderLayer
Conditionally. sword, head, clothes, etc. under them we reserve 10 "layers"))
and now if Y = 0., then the layers of the character will be (1,2,3 ..)
if he became in another row and Y = 1 then the layers of the character become (11,12 ,13...)
but this is one of the ways to avoid layering.
or use not sprites, but honestly in 3D arrange Quad or Plane along the Z axis))

H
HeroYukki, 2019-02-26
@HeroYukki

Double-check the z-coordinates of your characters' child elements (hats, heads, etc.). Most likely there is a conflict between local and global coordinates.
The simplest thing is to increase the gap in z-coordinates between the characters themselves. Either reduce the gap between child elements (hats, hands, etc.) or both.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question