private void StartNewTrail() { trailCount++; lastTrailLength = 0.0f; GameObject trailObject = new GameObject("trail_" + trailCount); currentTrail = trailObject.AddComponent <Trail>(); currentTrail.AddPathPoint(new Vector3(transform.position.x, transform.position.y + trailDistance, transform.position.z)); currentTrail.AddPathPoint(new Vector3(transform.position.x, transform.position.y + trailDistance, transform.position.z)); }