How would I write a script to make a cursor disappear when I press a key on my keyboard and then reappear when I press that key again?
1 Answer
1Hi,
Try something like this ( javascript )
function Update () {
if ( Input.GetKeyDown ("space") ){
Screen.showCursor = !Screen.showCursor;
}
}
Hope it helps,
Jean
excuse me which gameobject would i put the script in?
– darkforces555Yo could put this on any game object in any scene and it would work (in that scene of course).
– WuzseenI put this in a empty(gameobject>>>Create Empty) and it didn't work for me BTW i changed the space to a c does it have to be c Thanks for responding so quickly :)
– darkforces555thanks it worked
– darkforces555No Problem!
– adrennalinpro