Apply a shadow bias to prevent self-shadowing artifacts. The specified value is the proportion of the trail width at each segment.
using UnityEngine; using System.Collections;
[RequireComponent(typeof(TrailRenderer))] public class ExampleClass : MonoBehaviour { private TrailRenderer tr;
void Start() { tr = GetComponent<TrailRenderer>(); tr.material = new Material(Shader.Find("Standard")); tr.castShadows = true; tr.receiveShadows = true; tr.shadowBias = 0.3f; } }