- Home /
Can't get TrailRenderer behind gameObject.
I am trying to create a simple skid behind my car but the trailrenderer constantly draws over it and not under. I have played with the order in layer settings countless times but cannot get anything to work. Here are my settings. Would love some help.
I've tried same sorting layer and different numbers, different sorting layers, above and below and nothing works.
For a mobile game is it viable to just use a particle system for this? I feel this is more light weight which is why I want to do it this way but will settle for particles if the performance isn't effected.
Thanks
[1]: /storage/temp/119119-insp.jpg
Answer by unity_lMIeOVJm710RxQ · Aug 14, 2018 at 04:26 PM
I had the same problem for my space shooter game, and have found two possible solutions. Haven't tried them in a car racing scenario, so play with them out and see if either one works for you.
Add a child object below the vehicle and attach the TrailRenderer to that. Worked fine for me in single-player, but I didn't get it to play nice with multi-player.
Adjust the color of the trail to make the first part of the trail transparent (alpha = 0). The most recent part of the trail is still on top of the vehicle, but it's just transparent pixels so it doesn't look weird.