- Home /
is there any way to group sprites? - Unity2D,
i have some mobs in my game, in which their 2Dcolliders are set to trigger, my wolf is made out of multiple sprites, because i need to animate it, the body has order in layer of 4 and the eyes and ears have an order in layer of 5,
but the problem is, when 2 wolfs walk trough eachother this happens:
is there any way of grouping objects's sprites together? or any solutions pls :(!
Answer by Vega4Life · Aug 05, 2019 at 11:18 PM
Yes there is a way to group up your sprites. https://docs.unity3d.com/Manual/class-SortingGroup.html
Just put the sorting group script on the parent object. Then all your cats won't be z-fighting. Also using this, the parent sprite with the greatest Y value, will render itself and all its children first. Pretty handy.
Your answer
Follow this Question
Related Questions
Sprite Mask seems to override Sorting Layer preferences... 0 Answers
How to merge Sorting Layers ? 1 Answer
Sorting Layers in a 3D Environment 1 Answer
Unity Game View won't refresh my sprites 1 Answer
What is sortingLayerID used for? 2 Answers