I got a GUI.Box placed on screen using some script I got from the 3rd person tutorial.
var nativeVerticalResolution = 420.0;
var testY = 0;
var testX = 0;
function OnGUI () {
var testOffset = Vector2(testX, testY);
GUI.matrix = Matrix4x4.TRS (Vector3(0, 0, 0), Quaternion.identity, Vector3 (Screen.height / nativeVerticalResolution, Screen.height / nativeVerticalResolution, 1));
GUI.Box (Rect(testOffset.x,nativeVerticalResolution - 64 - testOffset.y,128,64),"Loader menu");
}
I now want to place a sphere next to the GUI
var mySphere : Transform;
var myx = 0;
var myy = 0;
var myz = 1;
var nativeVerticalResolution = 420.0;
function Update () {
var p = camera.ScreenToWorldPoint(Vector3(myx,nativeVerticalResolution - myy,myz));
mySphere.transform.position = p;
}
it works somewhat, but when I go into fullscreen the sphere is no longer where I want it to be. I can’t figure the offset I need to have the sphere alwasy be placed relative to the GUI
61922–2263–$help2_274.rar (288 KB)