- Изменено
Layer order problem when using multiple atlas
Hello, here are some questions about loading atlas in Unity.
I try to use multiple atlas for the asset. One atlas for the animal body, another atlas for the clothing.
But those two atlas seem to cause the layer order problem in Unity.
(The layer of clothing atlas move to be back and something moves to the front automatically, without any action from player or clicking)
What can I do in order to fix this problem?
Here is the code.
Spine setup code:
m_CharacterSpine.skeletonDataAsset = AssetLoader.LoadAsset<SkeletonDataAsset>($"spine\\job\\{data.career.spineKey}\\character_SkeletonData");
m_CharacterSpine.initialSkinName = $"char00{data.setting.id.ToString("00")}";
m_CharacterSpine.Initialize(true);
Set spine anima code:
m_CharacterSpine.AnimationState.SetAnimation(0, anima, true);
Here is the video.
Thank you so much!
Welcome to the Spine forum!
To solve the incorrect sorting, please add a Sorting Group
component (https://docs.unity3d.com/ScriptReference/Rendering.SortingGroup.html) to the skeleton GameObject.
Please see the following section of the spine-unity documentation:
spine-unity Runtime Documentation: Preventing Incorrect Sorting
Thank you so much!! It works!
I'm glad to hear it works! Thank you for getting back to us