I’m trying to fill the screen with a plane which will be my play Area for an Android game. The thing is that this code:
playArea.transform.position = new Vector3(0f, 0f, 5f);
var frustumHeight = 2.0f * Mathf.Tan(Camera.main.fieldOfView * 0.5f * Mathf.Deg2Rad) * playArea.transform.position.z;
var frustumWidth = frustumHeight * Camera.main.aspect;
playArea.transform.localScale = new Vector3(frustumWidth, 1.0f, frustumHeight);
doesn’t seem to work. I get 3.849002 for height and for width 5.773502, when I would need 1.535 for height and 2.31 for width (approximately).
Thanks for any insights!