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";
	}

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)…