- Home /
TrailRenderer sorting layer problem.
Hey Everyone, I'm running into an issue with a TrailRenderer that I have attached to an object. It's working fine, except that it's rendering behind everything in my scene. I have tried to change the sorting layer name of the trail renderer, but that's not working. Any ideas?
Thanks.
public void setTrailRenderer()
{
TrailRenderer tr = this.GetComponent<TrailRenderer>();
tr.sortingLayerName = "Foreground";
}
Answer by Jonesy19 · Mar 31, 2015 at 04:25 PM
In case anyone is still running into this issue, I have found a workaround...Here is a link to the thread (it is dealing with particle systems and not trail renderers, but the solution is still the same)... http://answers.unity3d.com/answers/937071/view.html
Answer by ComeSweetDeath · May 31, 2014 at 02:21 PM
http://answers.unity3d.com/questions/593897/trailrenderer-coexisting-with-sprites.html http://answers.unity3d.com/questions/608095/trail-renderer-and-sorting-layer-problem.html
Thanks for the response, but these answers simply say to do what I have already written in the code above, which is to change the sortinglayername (and I have also tried changing the sorting layer order).
I have same issue too, it seems to ignore the sorting layer name change in code