Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Gav (HeyBud) on August 29, 2014, 08:58:34 PM

Title: Can you combine 3D meshes in Sorting Layers?
Post by: Gav (HeyBud) 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  (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?
Title: Re: Can you combine 3D meshes in Sorting Layers?
Post by: Lane 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.
Title: Re: Can you combine 3D meshes in Sorting Layers?
Post by: Gav (HeyBud) 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 (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.