So I have a raycast starting from an empty GO which updates its own position based upon the rotation of another GO. I have the raycast direction set to the GO’s forward but for some reason the the line renderer isis always at the 0,0,0 position. Any idea what might be causing this? It was working fine before but once I made the script so that the ray would stop upon colliding with an object, it stopped working. Collider script is shown below. (end is a RaycastHit obj)
if (Physics.Raycast(lazor, out end, Mathf.Infinity)){
if (end.collider.tag == "Object")
lines.SetPosition(1, lazor.GetPoint(end.distance));