Sprites Showing up Behind Tilemap???
So, I'm making a 2d game demo for school, and I recently imported a tile map into the game using TIled and Tiled2Unity. I've done this before with no issue. This time, for some reason, the player was invisible. I then swapped the game to 3d, just so I could see where the player was in the editor, and when I did that I saw that the player was "pinned onto" the back of the tilemap instead of the front. So, I changed the Z position to -1 and it worked...In the editor. Once I hit play, something automatically set the players position to 0 again, and he ended up behind the tilemap again. His sprite doesn't break in other scenes, and it won't let me apply the z-position to the player prefab. Please help! This is due soon, and I can't figure this out. Any help is appreciated. Thank you!
Answer by NotJoosan · Aug 13, 2021 at 02:24 AM
I know this post is old but I found a solution. Go to your tilemap and on the tilemap renderer open additional settings and change the "Order in Layer" to -1. Hope this helps to anyone else who has this issue.
Answer by ParadoxPlatypus · Apr 20, 2021 at 03:12 PM
@ajmc123 you have to change the object's sorting layer you can find that in the sprite renderer,you have to change its sorting layer which is in the sprite renderer
Answer by ajmc123 · Feb 05, 2019 at 01:03 AM
So, After messing with my game a bit, I've found that for some reason the child object of my player is extremely screwy. If I set it to be in front of the player (z=-1) It works in the 3d editor, but as soon as I set it back to 2d the object is behind the player, even though the z value has not changed. This is quite frankly pissing me off, and idk how to fix it.
I've also found that the z-values completely change in different scenes.
Your answer
Follow this Question
Related Questions
Sprite AI rapidly flipping to try and face the player. This is driving me insane. 0 Answers
My sprites are pixelated in the game view 0 Answers
Tilemap : problem rotating and flipping a group of tiles 1 Answer
Issue with slopes in unity 2D, can't find solution. 1 Answer
Sprite slice missing part of the image 0 Answers