Tricks for Isometric Games in Unity
Events
Subscribe:  iCal  |  Google Calendar
Milwaukee US   17, Jun — 22, Jun
New York US   17, Jun — 20, Jun
St. Petersburg RU   19, Jun — 21, Jun
TBA BR   22, Jun — 24, Jun
Amsterdam NL   25, Jun — 28, Jun
Latest comments
by Yes
4 hours ago

Gabe is amazing and im happy to have him basicaly be the face of gaming. If you have something against him reply to this, i would love to discus

by Kai Marshall
20 hours ago

Awesome! So proud of you!!! <3

Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. rv altitude

Tricks for Isometric Games in Unity
23 July, 2018
News

The Unity team has recently shared an article by Martin Pane on making isometric games inside the engine. The task is not that simple, and these tricks can really help you get started. 

A short piece to get you interested:g

Let’s start by taking a look at the end result:

The first part we are going to focus on is on how to dynamically make sprites move around other sprites (behind and in front of them), giving a sense of real depth. The SpriteRenderer component has 2 properties that allow us to change the rendering order of sprites in the scene.
  • Sorting Layer
  • Order in Layer
To be able to change the rendering order of multiple sprites in real time, we need to modify some values so that when objects move around the scene, they always render correctly. We could modify the “Order in Layer”, but it only accepts integers, and we have a better option. We are going to use the Z axis.

The priority order when rendering a sprite in Unity goes like this, from highest to lowest:

If two sprites share the same “Sorting Layer” and “Order in Layer”, the one closest to the camera (in 3D World coordinates) gets rendered first.

Knowing this, we just have to write a small script that modifies the Z position a fixed amount relative to the Y position, right? You’re close, but first let’s explain a small concept crucial in understanding how to set a sprite’s ground floor. This “floor” is where the sprite would be touching the ground if it were a 3D object. Here are some examples:
What we have to do now is modify the Z position of the sprites when the Y position is modified. Let’s take a look at this in 3D:

Make sure to study the full guide here

Source: unity.com

Leave a Reply

avatar
Related articles