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

Character is behind the panel

Discussion in 'Editor & General Support' started by SuperCrow2, Aug 16, 2020.

  1. SuperCrow2

    SuperCrow2

    Joined:
    Mar 8, 2018
    Posts:
    584
    I am not sure if this goes here, but as you can see in diagram A, it looks boring and ugly being behind it. Proof in diagram B that hes behind it. How do I put him infront of the panel?

    Diagram A:
    upload_2020-8-15_20-57-24.png

    Diagram B:
    upload_2020-8-15_20-58-17.png


    Hierarchy:
    upload_2020-8-15_20-59-12.png



    Adjusting the "order in layer" didn't work.

    PS: That character model isn't final lol
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    If your canvas is in "Screen Space - Overlay" mode, then Canvas UI elements will always be drawn on top of game-world objects. Your player appears to be a game world object with a sprite renderer, and your panel appears to be a UI Image component on a canvas.

    If you want your player drawn on top you need to either:
    • Switch your canvas to Screen Space - Camera mode and set the Plane Distance so that UI elements are placed behind certain game-world objects
    • Make your player also a UI element.
    • Turn your "panel" into a game world sprite.
    • Switch your canvas to World Space (probably a bad idea)
     
    drewjosh likes this.
  3. SuperCrow2

    SuperCrow2

    Joined:
    Mar 8, 2018
    Posts:
    584
    I did option 1 and it worked perfectly, thanks!
     
  4. drewjosh

    drewjosh

    Joined:
    Sep 24, 2019
    Posts:
    23
    This solved my problem. Many thanks!