Hello, i want to set up an easy trail behind a ball (so that it looks that you “paint” while moving the ball). at the moment it looks like this:
the problem is, that the line is getting thiner and thicker depending on the direction. and i want to have i constant - thick line. here are my settings:
the trail renderer is on a different game object then the ball so that the line renderer is not drawn in the middle of the ball. for this i use this script:
using UnityEngine;
using System.Collections;
public class CopyPosition : MonoBehaviour
{
public Transform itsTarget;
void Update ()
{
transform.position = new Vector3(itsTarget.position.x,0.96f,itsTarget.position.z);
}
}
that leads to that the line follows the ball on the x and z axis, but always stays at the Y axis. which is good, no errors here, just want to mention it
so, how can i have a constant thick line with my trail renderer?
Hi, The TrailRenderer will always try to face towards the camera, when you do a turn it has to twist itself to face the camera and you got the thin parts. You could create the mesh procedurally and use the normal of the surface instead of the camera or use a tool to do this for you such as Vectrosity. A quick fix may also be to reduce the Min Vertex Distance although this will increase the triangle count.
I can’t reproduce the error either. On another note, there really is no point in having the CopyPosition script; you should just parent the trail renderer’s game object to the ball’s game object. You can still have it offset.