0
\$\begingroup\$

I'm facing a rendering issue in Unity involving a GameObject that uses a layer from a Tile Palette. I’m utilizing a Tilemap for my game’s environment, and my camera is set to Perspective. While the rendering works fine for individual objects, when my main GameObject, which has this Tile Palette layer, interacts with the Tilemap, the rendering does not respect the correct sorting based on height. This results in some parts of the object being drawn above or below the tilemap incorrectly.

Example

I need Unity to treat the Tile Palette layer as part of the same rendering context and correctly sort it based on the height (Y-axis) relative to the Tilemap. I have already tried adjusting the Transparency Sort Axis to (0, 1, 0) and tweaking Sorting Layers and Order in Layer, but the issue persists.

What I've tried: Setting the Transparency Sort Axis to (0, 1, 0). Manually adjusting the Order in Layer values for the Tile Palette layer. Adding a Sorting Group component to the main GameObject, but since there isn’t a traditional parent-child relationship, this didn’t resolve the problem. Adjusting the orientations and Sorting Layers, considering that the camera is in Perspective, but it hasn't fixed the issue either. Question: How can I adjust the rendering order so that the Tile Palette layer in my GameObject is rendered correctly relative to the Tilemap, considering the height (Y position) of the object and the fact that my camera is in Perspective mode? Is there an effective way to manage the rendering order for a Tile Palette layer within a single GameObject?

Any help or guidance would be greatly appreciated!

\$\endgroup\$
3
  • \$\begingroup\$ The right part of that broken shard seens to be missing a collider as well. It would help as well if you include the actual setup of your map/ layers from the hierarchy. Sometimes order on how or where you added the items matter \$\endgroup\$ Commented Sep 27, 2024 at 16:10
  • \$\begingroup\$ it shouldn't have a collider, only the base, so the character can go behind the monolith \$\endgroup\$ Commented Sep 27, 2024 at 17:23
  • \$\begingroup\$ It looks like it uses 6 tiles, the bottom 2 left/ middle block movement, but the right bottom one allows the player to pass through. I dont mean the top row \$\endgroup\$ Commented Sep 27, 2024 at 17:28

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.