- Home /
Graphical issue in 2D mode.
I have next problem in my project:
When some object moving in the Y coordinates it also moving in the Z coordinates. This used for changing object layer (object can be in front of another object or behind). So the problem is that when object moving scene is lagging (object moves jerkily but fps is fine). If I disable the Z axis problem is gone but I need the Z axis. How to fix this?
P.S.: sorry for my English -___-
Are you using 3D model/objects?? If your objects are in 2D then I think you have no need to Z axis.
So then how I should move object in front of another object or behind them? I think it barrely possible without using Z axis. And yes this is 2D object. With Sprite renderer.I think you have no need to Z axis
Use sortingOrder. This will help you to manually set render order of your spriteRenderers.
Answer by Zealord · Mar 20, 2015 at 11:15 PM
You shouldn't use the Z-layer to move characters or renderables in front of eachother in a 2D game with the purpose you described. You should use the sorting layers on the sprite renderers to fix that issue. Moreover, if you think it is "barely possible" to move it then read up some more on the documentation regarding these topics!
Sorting order I forgot about it! Thank you! By the way if "barely possible" looks like "impossible" then sorry I didn't mean that T_Т
Glad to see it was fixed then! I'm far from being good myself and I also think this at times.
Your answer
![](https://koobas.hobune.stream/wayback/20220613190729im_/https://answers.unity.com/themes/thub/images/avi.jpg)