How to allow cursor while during pop-up?

I have pop-ups which are shown in-game (basically just a canvas which is shown). But, since I'm using First Person Controller, the cursor is hidden and controls where the player is looking. When a pop-up is opened, I would like to release the cursor and have it able to click on UI elements and not move the player look direction, then be able to programmatically re-enable it once the modal is closed.

Thank you
 
You need to set Cursor.lockState to CursorLockMode.None. You may also need to set Cursor.visible to true. Then when exiting out of the UI, set Cursor.lockState back to CursorLockMode.Locked, and Cursor.visible to false. This is how the demo scene does it.
 
You could just get references to those UI components (e.g. via public variables in your script's inspector), i.e. Text, Image, and just disable/enable them (e.g. theTextComponent.enabled = false).
 
Top