Question by
hoanjizi · Aug 16, 2020 at 05:06 PM ·
scripting problemunity 2dskinning
[ Help!! ] Issue with position Z in object
I'm newbie unity, I build a character with Skinning Editor. When I running it with animation the view of character allows on top:
I set position z = 10 but don't work. code init character:
GameObject go = Resources.Load("characters/BaseMale", typeof(GameObject)) as GameObject;
character = Instantiate(go, new Vector3(-36, -0.5f, 0f), Quaternion.identity);
character.transform.localScale = new Vector3(0.4f, 0.4f, 1f);
character.transform.Rotate(new Vector3(0f, 180f, 0f), Space.Self);
Please help me fix the issues. My English not good. Thanks
Edit: I have found a solution that uses Sort Group and Sort Layer. Here is the documentation: https://docs.unity3d.com/Manual/class-SortingGroup.html
capture.png
(42.7 kB)
Comment
Answer by xxmariofer · Aug 17, 2020 at 01:25 PM
2d uses order in layer in the sprite component not z axis
Thank you, How do character behind Glassman, please show me how to fix it.