- Home /
How to make sprite move behind part of tile
I'm trying to recreate Petalburg city from Pokemon Emerald as practice for working with Unity2d. I got most of the collision set up but I can't seem to get below to work.
The first image is how it's supposed to look. The second is how my game looks. The third is how the specific tileset for that area looks.
You need to make a sprite specifically for the house, with transparency where the house isn't.
Are your ground tiles and buildings all part of the same tilemap? If they are, you should separate them into 2, one for ground tiles and another for the buildings, trees etc. Also you would have the remove the "grassy area" from the building tileset that you are using in the third image you provided.
Answer by Tomer-Barkan · Nov 16, 2018 at 01:51 PM
Few issues here.
First, to answer your original question - you can't put one sprite behind PART of another sprite. It's either behind all of it, or in front of all of it. If you need it behind part and in front of other, you need to split it to two sprites.
Now, as for what you have - you should have one sprite for the green grass, and on top of it place the building, with transparent background like this. Then you place the building in front of the grass, and the character between the building and the grass.
Your answer
![](https://koobas.hobune.stream/wayback/20220612182218im_/https://answers.unity.com/themes/thub/images/avi.jpg)