Hello,
I have a problem with LineRenderer and Raycast Hit Point
I would like to make a sort of Laser from shoot position to hitpoint.
I do like this
LayerMask LayerHitable = (1 << LayerMask.NameToLayer("Player") | 1 << LayerMask.NameToLayer("Terrain"));
RaycastHit2D hit = Physics2D.Raycast(fireTurret.position, fireTurret.right, LayerHitable);
Vector3[] laserPoints = new Vector3[] { fireTurret.position, hit.point };
_lineRenderer.SetPositions(laserPoints);
_lineRenderer.enabled = true;
but it game it look like this *
It’s correct on the scene preview, but not on the game preview.
How can I fix that ?