- Home /
Question by
ham · Feb 03, 2014 at 11:42 AM ·
layersparentingsorting layers
changing sorting layer via script
hi guys , would anybody tell me please that how can i change the sorting layer via script , or atleast assign sorting layer of a gameobject to another object.... and Unfortunately i write my codes with javaScript thanx and more
Comment
Best Answer
Answer by Greg D · Jun 30, 2014 at 09:33 PM
Hi! not so shure about how to do it in JS since i use C#, but you can access sorting layer via scripting trough renderer, this is working for me:
myObject.renderer.sortingLayerName = "TheSortingLayerName";
hope it helps!!!
(sorry for my english, it is not my native lang.)