Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

3D Objects won't render correctly?

Discussion in 'Editor & General Support' started by Sleepyheadd, Nov 14, 2021.

  1. Sleepyheadd

    Sleepyheadd

    Joined:
    Jul 8, 2018
    Posts:
    4
    Hi! So this is my first time using Unity in a few years and I'm wondering why this feature I recently implemented messes with the rendering order.

    I have two blocks that render correctly when are they put into the game, but when I use this tool that modifies their scaling, certain camera angles have the elongated block rendering in front of the normal block.
    Screenshot (69).png Screenshot (70).png
    All I've done between these two photos is move my in-game camera. What's causing this, and is there an easy fix for it?

    Thank you for any advice!!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,956
    Looks like maybe you're using a shader that doesn't set Z depth properly, like a sprite shader or something.

    It might also do weird things if you set the scaling negative at any point in the transform hierarchy.

    Or maybe these are Gizmos? Not sure what the rules are for Gizmo draw order; I think it is immediate mode, but maybe someone else could chime in.
     
  3. Sleepyheadd

    Sleepyheadd

    Joined:
    Jul 8, 2018
    Posts:
    4
    Unfortunately the scaling never goes negative and these aren't Gizmos. I am using Unity's default shaders and I haven't explored those yet, so for now I could tinker around in those settings to see if that would fix anything. Thank you for the reply!