Search Unity

How to create 2D depth effect with Sprite and Mesh?

Discussion in '2D' started by Bardo98, May 29, 2017.

  1. Bardo98

    Bardo98

    Joined:
    May 28, 2017
    Posts:
    1
    Hi there, I'm doing a top down 2D game. My problem is to make depth to my game. So, I'll explain what I've done. I created a "Ground" Level with some tiled grass and a "Decorations" level with some trees on Tiled, and then converted it into Unity via Tiled2Unity. In Unity then I got my "Decorations" GameObject (that have a Mesh Renderer), "Ground" GameObject (Mesh Renderer too) and a Player previously created (that have a Sprite Renderer). I put the "Ground" GameObject in a "Background" Layer and the Player and the "Decorations" GameObject in a "Entities" Layer. So I'm stuck here. I do not know how to dynamically get Player in front of the trees and, after a certain point, behind them, in order to create some sort of depth. Is there any way to get this thing?


    P.S. I figured out how to make this kind of depth using a Sprite with another Sprite, but this means I'll have to place trees (and future decorations like bushes, rocks etc.) one by one. Is it better to place a lot of same sprites or use the tiled method?

    Sorry for the simple question, but I'm quite new on Unity, I'm still learning. :(

    Thanks for your time!