2
\$\begingroup\$

I'm developing an Isometric Game but I have problem apply the right layer for make, for example, a wall behind or in front of the Player depending on the Player position.

I'm able of getting works in an orthogonal map relating the y-axis value of an object with his layer but in an isometric map, the y-axis is not aligned with the editor one.

Anyone can help me understand how to manage this?

\$\endgroup\$
7
  • \$\begingroup\$ What is a "pg"? By the way, when you build a game in isometric perspective, using Unity in actual 3d mode with billboarding sprites might make things much easier. \$\endgroup\$ Commented Apr 6, 2016 at 13:24
  • \$\begingroup\$ sorry is PC - Player character \$\endgroup\$ Commented Apr 6, 2016 at 13:28
  • \$\begingroup\$ Why not use Unity's 3D and set camera to orthographic? - the result is the same and might be a lot easier if you're not worried about pixel-perfection. \$\endgroup\$ Commented Apr 6, 2016 at 13:34
  • \$\begingroup\$ @ArcaneEngineer Even in 3d mode you could get pixel-perfection by using a shader without texture filtering. \$\endgroup\$ Commented Apr 6, 2016 at 13:43
  • \$\begingroup\$ @ArcaneEngineer but how to get the 3d effect? \$\endgroup\$ Commented Apr 6, 2016 at 13:50

2 Answers 2

0
\$\begingroup\$

One solution is to build your world in 3D, then set the specific camera angle you want to look down on the level (isometric or any flavour thereof), and set the camera angle to orthographic.

\$\endgroup\$
2
  • \$\begingroup\$ For using a 3d world I need to implement the sprites in a mesh, is correct? \$\endgroup\$ Commented Apr 7, 2016 at 16:29
  • \$\begingroup\$ @smark91 Yes, your surroundings would need to represented as meshes. However your characters could still be represented as flat sprites. You could build very simple shapes to do the job for your terrain and buildings. \$\endgroup\$ Commented Apr 7, 2016 at 17:59
1
\$\begingroup\$

There are two methods that can work.

Method I

  1. Go To Graphics Settings

    Edit > Project Settings > Graphics

  2. Under Camera Settings Change Transparency Sort Mode from default to Custom Axis.
  3. Now Change Transparency Sort Axis Z value to 0 and Y value to 1.
  4. Now it will take care of you Sprite Renderer's layering (according to Y axis value).
  5. You can also use Sorting Group Component to group multiple sprites to together.

Method II

  1. You can define multiple sorting layers in unity e.g. player, walls, tile map etc.

    Edit > Project Settings > Tags & Layers

  2. Inspector you can find Sorting Layers Menu
  3. You can find your defined sorting layers in each Sprite Renders Component or in case you are using UGUI Canvas component.

  4. If you are using Tile Map Make you on grid and change you sorting order of player according to grid cell index.

  5. You can define any function to calculate your sorting index.

\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.