Screen.lockcursor, and gui text.

So this question is a two-parter. So the first part is how to make the screen.lockcursor to be false. So in my game I use screen.lockcursor, and when I press ‘p’ to pause I want the cursor to unlock, because when I click it just locks back on. The second part is how to enable a GUItext. When I press O my objectives will show, but to save some time I use a GUItext to display the objectives. at first I want the objectives to say nothing, and when O is pressed the objectives will show. Thank you for the help.

1 Answer

1

Well to unlock the cursor you set Screen.lockCursor to false;

Screen.lockCursor = false;

I tried that but when I clicked on the screen to go through my pause menu the cursor just locked again.

–

Are you locking it each frame in another script??

–

I'm using the start function to lock it, and I'm using update to unlock. I was thinking that updating every frame that the cursor was unlocked that it would work, but when I click on my pause menu, it just locks the cursor again.

–

I ended up looking at the script, and then experimented with it a bunch and figured it out. But for helping I'll accept this answer as correct.

–