As shown in the pictures, my LineRenderer and Raycast are not in the same direction. I would like to match the Raycast to the LineRenderer, as that seems most suitable.
void Update()
{
lineRenderer.useWorldSpace = false;
lineRenderer.SetPosition(0, Vector3.zero);
Vector3 fwd = transform.TransformDirection(Vector3.forward);
RaycastHit hit;
Debug.DrawRay(transform.position, fwd * 30, Color.black, 2, false);
if (Physics.Raycast(transform.position, fwd, out hit, 30) && input.RightTriggerDown)
{
if (hit.transform.tag.Equals("MenuItem"))
{
Debug.Log(hit.transform.name);
StartMenu.instance.TriggerMenuInstruction(hit.transform.name);
}
}
}