I’m creating a Stealth Artefact for university, where the stealth AI is pretty much the same as Metal Gear Solid.
Since doing this, I am trying to visualize the enemies sight within the editor so it’s easier for me to plan the layout etc.
I am currently using this to ‘draw’ a field of view.
void OnDrawGizmos()
{
Gizmos.color = Color.red;
Vector3 direction = transform.TransformDirection(Vector3.forward) * 5;
Gizmos.DrawFrustum(transform.position, 45.0f, 10.0f, 0.0f, 1.0f);
//Gizmos.DrawRay(transform.position, direction);
}
But in the editor, this is what I’m seeing with the frustum that I’ve used.
The frustums always seem to lock into the centre of the world.
Is there a way to change this, or another method to visualize a field of view?