I’m trying to render the trail that a projectile particle has, behind (in layers) of the projectile. This Projectile is a prefab.
I’ve tried everything, sorting layers, order, debug, switching parent-child. Can anyone help?
I’m trying to render the trail that a projectile particle has, behind (in layers) of the projectile. This Projectile is a prefab.
I’ve tried everything, sorting layers, order, debug, switching parent-child. Can anyone help?
Three (3) primary ways that Unity draws / stacks / sorts / layers / overlays stuff:
In short,
The default 3D Renderers draw stuff according to Z depth - distance from camera.
SpriteRenderers draw according to their Sorting Layer and Sorting Depth properties
UI Canvas Renderers draw in linear transform sequence, like a stack of papers
If you find that you need to mix and match items using these different ways of rendering, and have them appear in ways they are not initially designed for, you need to:
There may be more than one solution to try.
Additional reading in the official docs:
And SortingGroups can also be extremely helpful in certain circumstances: