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. Dismiss Notice

I have a problem with the z axis in a 2D game.

Discussion in '2D' started by KadzitsuCross, Nov 8, 2020.

  1. KadzitsuCross

    KadzitsuCross

    Joined:
    Sep 26, 2020
    Posts:
    10
    I have a problem with the z axis in a 2D game. my camera is located on the z axis at -10, the background is at 0, and I have a prefab with text that should appear from the script, everything is fine with the script, the prefab appears but it is drawn behind the background and no matter how I change the z axis the prefab is still not visible. does anyone know how to solve this problem?
     
  2. VishwasGagrani

    VishwasGagrani

    Joined:
    May 12, 2018
    Posts:
    81
    Can you share a screenshot?

    Probably you could be confusing the direction of z-axis. And setting the prefab away from camera instead of near the camera.
     
  3. MrPaparoz

    MrPaparoz

    Joined:
    Apr 14, 2018
    Posts:
    156
    Check the sorting layers if they are sprites.