I loaded the model I made with Maya into Unity, but sorting layer doesn't work.
Can I set the sorting layer except for sprites?
I look forward to your kind cooperation.
unity3d
You can configure it by creating a script.
The SpriteRenderer component that draws sprites has a SortingLayer configuration item on the Inspector, but the MeshRenderer and SkinnedMeshRenderer components do not have a SortingLayer configuration items on the Inspector.
At first glance, the SortingLayer properties are not configurable, but the Render class, which is the base class of MeshRender and SkinnedMeshRender, has them, so you can configure them on the script.
class SampleClass—MonoBehavior
{
SerializeField
private string m_layerName="";
void Start()
{
varrender=GetComponent<MeshRenderer>();
if(render!=null)
{
render.sortingLayerName = m_layerName;
}
}
}
Please refer to the following article for a detailed explanation.
http://tsubakit1.hateblo.jp/entry/2015/01/05/233000
© 2025 OneMinuteCode. All rights reserved.