Line Renderer - not Perspective?

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 :wink:

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.

1 Like

Thanks for the high speed answer :slight_smile:
Will have a look at vectoristy since i saw a lot of people already recommending it.
Thanks!

Works fine for me with those settings
Has your texture got a weird alpha channel?

1 Like

Thats weird. Gonna check it again when i have a PC around. Have you also used an orthogrphic iso cam? But hey, thanks for testing!

It was a perspective camera, but i see nothing wrong in ortho either

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.

thats funky:
when my cam (ortho) has the XYZ settings: 29 -5 -10 i have the above behavior/problem. but i changed it to XYZ 5 26 -30 its works fine