• Unity
  • Change SortingOrder and OrderInLayer during runtime

Related Discussions
...

The SortingOrder and OrderInLayer appear to be exposed as public variable in the inspector for the SkeletonAnimation script. However, I cannot manage to access them via any code pulling in the SkeletonAnimation component.

Image removed due to the lack of support for HTTPS. | Show Anyway

Does anyone know how to access these in script? I need to change both during runtime for my game.

Those items in the inspector are purely shortcuts to the MeshRenderer's sorting properties.
Just change MeshRenderer's sorting layer and sorting order in code.

Despite being hidden in the inspector, those values are also serialized as part of MeshRenderer's object, not SkeletonAnimation.