Hello.
For draw ray with angle at right and left of my sprite, I using code below.
Vector3 center = transform.position + -transform.up;
Debug.DrawLine(transform.position, center, Color.cyan);
Vector3 rightDir = Quaternion.AngleAxis(45.0f, transform.forward) * -transform.up;
Debug.DrawLine(transform.position, rightDir, Color.cyan);
Vector3 lefttDir = Quaternion.AngleAxis(-45.0f, transform.forward) * -transform.up;
Debug.DrawLine(transform.position, lefttDir, Color.cyan);
But problem is when my sprite is not moving, drew ray seem correct but after moving, left and right rays are stick to center of screen. (Attached pictures)
when i used DrawRay instead of DrawLine in my code, all things seem are OK even after moving sprite. but affect of ray is exactly like (After Moving Picture).