How do i disable the hide cursor script
// Hide the cursor
Screen.showCursor = false;
when the gui box to this script is poping up
var target : Transform;
function Update () {
var other = gameObject.GetComponent("GUI Style Script");
if ( Vector3.Distance(target.position, transform.position ) < 25) {
other.enabled = true;
}
if ( Vector3.Distance(target.position, transform.position ) > 25) {
other.enabled = false;
}
}
And how do i enable the hide cursor script when it pops away
Why can’t you just set Screen.showCursor back to true when youre displaying the GUI (in that first if block) and set it back to false in the second if block?
if ( Vector3.Distance(target.position, transform.position ) < 25) {
other.enabled = true;
Screen.showCursor = true;
}
if ( Vector3.Distance(target.position, transform.position ) > 25) {
other.enabled = false;
Screen.showCursor = false;
}
}
then you can forget about the other screen.showCursor script
Why can’t you just set Screen.showCursor back to true when youre displaying the GUI (in that first if block) and set it back to false in the second if block?
if ( Vector3.Distance(target.position, transform.position ) < 25) {
other.enabled = true;
Screen.showCursor = true;
}
if ( Vector3.Distance(target.position, transform.position ) > 25) {
other.enabled = false;
Screen.showCursor = false;
}
}
then you can forget about the other screen.showCursor script
Well i’m kinda new to scripting. But thanks!
oh right, haha, I thought there might have been some reason you couldn’t do it
but how do i disable the mouse look script when the gui box pops up?