playMaker

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

Gav (HeyBud)

  • Full Member
  • ***
  • Posts: 126
    • Tumblr
Can you combine 3D meshes in Sorting Layers?
« on: August 29, 2014, 08: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 30, 2014, 12:41:11 AM by Sarcophagav »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Can you combine 3D meshes in Sorting Layers?
« Reply #1 on: August 30, 2014, 01:34:11 PM »
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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Gav (HeyBud)

  • Full Member
  • ***
  • Posts: 126
    • Tumblr
Re: Can you combine 3D meshes in Sorting Layers?
« Reply #2 on: August 30, 2014, 03: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.