I have an error in a script that’s supposed to stop the GUI from distorting on maximized screen. Here’s the code:
void Start() {
transform.position = Vector3.zero;
transform.localScale = Vector3.zero;
var guiTex = GetComponent<GUITexture>();
guiTex.pixelInset = new Rect(Screen.width - 138, Screen.height - 138, -512, -256);
}
but here’s the error i get:
Assets/GUILock.cs(1,6): error CS0116: A namespace can only contain types and namespace declarations
I don’t see whats wrong with it!