Need help with a camera's projection into 3D space

Hi, I’m looking for help with finding the corners for a plane that will be flush with the FOV angles of the camera, filling it entirely.

I’m in the process of making a game with a UI style similar to old school first person 3d dungeon crawlers, around the early 1990s era, like Ambermoon or Ultima Underworld. I’ve got the mouse position relative to the UI viewport as a percentage. (This is probably hard to get from my wording, so here’s some examples of what I mean - middle of the screen is 0.5,0.5 - top left is 0,1 - bottom right is 1,0).

I was thinking that I could translate the percentage easily to Vector3 based off corners of said plane, but I’m not sure how to set the corners to reference off. I’ve tried many things, but I’d like a new perspective from somebody with more (read: any) graphics programming knowledge.

Thanks!

Hi, me again. I figured it out. (This is for whoever finds this forum post on google lol).

My code:

public GameObject[ ] cornerCheckers;

cornerCheckers[0].transform.position = cameraToUse.ViewportToWorldPoint(new Vector3(1, 1, 6)); // t-l
cornerCheckers[1].transform.position = cameraToUse.ViewportToWorldPoint(new Vector3(0, 1, 6)); // t-r
cornerCheckers[2].transform.position = cameraToUse.ViewportToWorldPoint(new Vector3(0, 0, 6)); // b-l
cornerCheckers[3].transform.position = cameraToUse.ViewportToWorldPoint(new Vector3(1, 0, 6)); // b-r