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
582 PHP ssh2_scp_send fails to send files as intended
620 Uncaught (inpromise) Error on Electron: An object could not be cloned
916 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.