I’m trying to draw my enemy’s line of sight, so I can get a visual representation of what he can see, but when he rotates, the lines aren’t updating properly with his relation to his z-axis.
Vector3 losLeft = transform.TransformDirection(Quaternion.Euler(0, -45, 0) * transform.forward) * maxSeeingDistance;
Vector3 losRight = transform.TransformDirection(Quaternion.Euler(0, 45, 0) * transform.forward) * maxSeeingDistance;
Debug.DrawRay(transform.position, losLeft, Color.green);
Debug.DrawRay(transform.position, losRight, Color.green);