Map Layer

# About the Course

You can use a map layer to make your game look more stereoscopic. Let's see how the Map Layer window looks, and how to use it. You'll be able to understand the order of layers and use them for your game.

# Map Layer Location

Based on the default panel settings, the Map Layer window is located at the bottom center. When you have closed the tab, you can click Panels - Map Layer to open it.

[{"index":"Maker screen default location","0":"[png](1661140579188d3b512992aad4a18bbc9411950f72d74)"},{"index":"Panels - Map Layer","0":"[png](16595798309379692d0ca050848bea645debe9cb9286c)"}]

> Tip Select Panels - Reset Panels to rest your panel status. [png](1682665165619440c6c5225ce4744b4e76a8245f1401a)

# Map Layer Window Configuration



[{"Numbers":"[jpg](1634541272181b5c1a55fcf3d49b19734d25913c38583)","Icon":"[png](16345366745866d71bbf1f9f3454786e3f3477e268b01)","Description":"You can only check a single layer chosen. None: All layers are activated.Focus: Only a single layer chosen is activated. Other layers look dark and half-transparent, which tells you that they are deactivated. You cannot choose deactivated layers in the scene.","Unnamed: 3":"nan"},{"Numbers":"[jpg](1634541300837cb541c2f44e046a79bb1901a885aa8ac)","Icon":"[png](1634538484615e92129425be84676a7af1ba82a8c1510)","Description":"Entities placed on deactivated layers will be hidden.They're only hidden in the creation process. All deactivated layers become activated when running tests or releasing the game.","Unnamed: 3":"nan"},{"Numbers":"[jpg](163454131465069e090278448490f965207e9a4a10348)","Icon":"Layer","Description":"You can create up to 10 Layers.","Unnamed: 3":"nan"},{"Numbers":"[jpg](1634541326353d8628c1473944497bf376acb7a65ca45)","Icon":"[png](1634537017666e283f66030444da08eddef99819b2b07)","Description":"Lock the layer chosen. You cannot select or edit entities from a locked layer.","Unnamed: 3":"nan"},{"Numbers":"[jpg](1634541338689678f574f21e54a6ca533737924124d7e)","Icon":"[png](16345369150225f875c8c218444c58189ffac05201631)","Description":"You can add an empty layer. A new layer will be added on top of the entity that was last created, with the name LayerN(number).","Unnamed: 3":"nan"},{"Numbers":"[jpg](163454135201207284554a25b498380fff224cd767f6b)","Icon":"[png](1634536995484055ff8f9ba99415486f815f599c0702d)","Description":"Delete a layer. Please be careful as deleted layers cannot be restored.","Unnamed: 3":"nan"}]

# Understanding Map Layer

A layer is like a transparent board that you put on the map screen. You can place multiple entities on top of it. Put another transparent on top of them, then you can place new entities. The bottom layer in the layer window is located furthest back in the map screen, and the top layer is at the front. Entities placed on layers are together affected by the order. If you move the bottom layer to the top, the order of entities will change as well. [png](1634601877817d0b37c6d8fbb4f668d37ea25d1783418) [png](1634601899530a6e1a61208ba414ba15bb4a138e038de)

#### Layer Priority Rules

In the Maker, the order of entities is decided as follows:

  1. Map Layer (SortingLayer of SpriteRendererComponent)
  2. OrderInLayer property of SpriteRendererComponent
  3. Position Z value of TransformComponent Please refer to [Changing Location, Size, Rotation of Entities](/docs?postId=82).



#### Model's Layer Order

For placement convenience, each model type has default values for OrderInLayer.

[png](1682664093514566667bb5ccc473ca19732e72f275630)

Default values for OrderInLayer in each model type

[{"OrderInLayer Value":"0","Model Type":"Object"},{"OrderInLayer Value":"1","Model Type":"Tile"},{"OrderInLayer Value":"2","Model Type":"Monster, NPC, foothold, ladder, rope, portal, trap, item"},{"OrderInLayer Value":"3","Model Type":"Other user's avatar"},{"OrderInLayer Value":"4","Model Type":"My avatar"}]

You can modify classified values to change the placement order, but please avoid entering a value that's "3 or higher". Otherwise, your avatar may be covered when playing the World.

> Learn more If you place multiple entities from the same classification in a single layer, the last entity you placed will be located at the front.

# Relationship Between Map Layer and Player Avatar

A player avatar is an entity, but it has a few differences from other entities.

  * A player avatar in editing state cannot be placed on the map, and it doesn't belong to a specific layer.
  * Other entities belong only to the first map layer they are placed on, regardless of their movement. However, the player avatar will continue to change where it belongs on the map layer according to the entity it is currently stepping on (tile, foothold, etc.). Take a look at two examples to understand the relationship between map layers and player avatars.



#### Example 1

The dark green tile is placed on Layer1, and the yellowish green tile on Layer2. The player avatar on the dark green tile belongs to Layer1 until it jumps in the air. However, as soon as it lands on the yellow tile, it belongs to Layer2. [gif](16346025247675038e0d2fd854f5e80a5359fe45d2df8)

#### Example 2

Each of the 4 layers have tiles and objects. (OrderInLayer is set to default.) Player avatar's map layer depends on the entity layer it's standing on. So it starts to move from the bottom layer1. Tree objects on the green tile are placed on Layer4. Therefore, the avatar stepping on the green tile moves behind the tree objects.

When the player avatar moves to the yellowish green tile, it belongs to Layer3. Toy objects on the yellowish green tiles are placed on Layer2. Because the yellowish green tile belongs to a layer on top of Layer2, the avatar walks past the toy objects.

You can make good use of layers and objects to stage the avatar going through burning fire or thick bushes. [gif](1634602745986d158da5858dc44be9481dbd8b21ef50e) [png](1634620453053bba58d9571604df192a0ce5d56451b6d)

# Summary

You can use map layers to classify and manage entities by their characteristics. This is especially useful when you're making a vast and complex map. If this is your first World, you might drift away from the original plan. Learn the rules of using layers so that you can improvise your way to make the game.