Quantcast
Channel: Questions in topic: "independent"
Viewing all articles
Browse latest Browse all 102

State object error when implementing Matrix4x4.TRS solution to set resolution independence

$
0
0

I'm trying to set resolution independence by setting my GUI.matrix via the following code:

private float nativeHorizontal = 800.0f;
private float nativeVertical = 600.0f;

void Start() {
    // set resolution independence
    GUI.matrix = Matrix4x4.TRS( Vector3.zero, Quaternion.identity, new Vector3(1.0f*Screen.width / nativeHorizontal, 1.0f*Screen.height / nativeVertical, 1.0f));
}

Weird thing is, I get the following runtime error:

InvalidOperationException: Operation is not valid due to the current state of the object System.Collections.Stack.Peek ()

I've tried searching for Answers (pardon the pun), but I can't find anything. I don't understand how there could be a "stack" error when call the TRS function. Can anybody enlighten me on this?

Thanks,

Dendro


Viewing all articles
Browse latest Browse all 102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>