LineRenderer doesn't go to Hit.Point

My LineRenderer doesn’t go to exactly hit.point, it goes to a few units below it.

I know this is because of some funkery involving world and local space, but I’m not sure how to fix it…

            if (bulletTrail != null && firePoint != null)
            {
                LineRenderer l = Instantiate(bulletTrail);
                l.transform.SetParent(firePoint.transform);
                l.SetPosition(0, firePoint.transform.position);
                l.SetPosition(1, hit.point);
                Destroy(l.gameObject, .1f);
            }

Any ideas?
Thanks!

Hi @Razputin,
make sure your LineRenderer component is set to use World Coordinates. If you do that then parenting it to another object will have no affect on the line’s position point locations.

if you do that and it is still offset, then your hit point is not where you think it is, or you have something else going on.

Debug.Log( "Hit point = " + hit.point + " > Line Pos = " + l.GetPosition( 1 ) ); `

to verify they are at the same location.