playMaker

Author Topic: Can you combine 3D meshes in Sorting Layers?  (Read 4235 times)

Gav (HeyBud)

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • Tumblr
Can you combine 3D meshes in Sorting Layers?
« on: August 29, 2014, 05:58:34 PM »
Hello,

I'm combining 2d sprites and 3d mesh game objects. I need the sprite to render in front of the 3d mesh even when the sprite is behind it.

After doing some research, I've determined that I can set the sorting layer of the mesh. The sprite renderer has a sorting layer by default in the inspector, but the mesh does not, so you have to set it by a script.

I tried Set Property and got the renderer > sorting layer and set it to be the same name as the sprite renderer. Then I set the order behind the sprite. This didn't work. Please help.

Check out my screenshot of fsm.http://imgur.com/ObZQ6vv

How do I set the sorting layer of a 3d mesh so that it's the same as the sprite renderer and see my sprite above the mesh?
« Last Edit: August 29, 2014, 09:41:11 PM by Sarcophagav »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Can you combine 3D meshes in Sorting Layers?
« Reply #1 on: August 30, 2014, 10:34:11 AM »
Hmm, dunno... Have you asked about this on Unity Answers board or the Unity Forums? That's more of a lower level Unity question, you'll probably get a quicker answer there, especially on the Answers board.

Gav (HeyBud)

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • Tumblr
Re: Can you combine 3D meshes in Sorting Layers?
« Reply #2 on: August 30, 2014, 12:00:57 PM »
Hi Lane, Thanks. I've been looking. I found this. https://gist.github.com/nickgravelyn/7460288#file-sortinglayerexposededitor-cs But it still doesn't make  the mesh behave how a sprite would in the same sorting layer as another sprite. Maybe i'm misunderstanding.  I'm trying to figure it out. Thanks though.