Locking Camera When Changing to Ingame Menu.

Hi there, Whilst switching from game to ingame menu It locks cusor and unlocks it so i can click buttons in menu. Though whilst the menu is up when I move cursor around to use menu it moves the FPS camera aswell. I simply want to just lock that camera and unlock it when in use. Is there something like Screen.lockCursor or would I need to lock all axes and unlock them (if so any idea) Newbie. THough ill understand most scripts.

You'll either need to: 1) temporarily deactivate the script that is moving the camera, or 2) change the camera script so that it checks whether your in-game menu is visible or not before moving the camera.

(2) is probably the way to go. One way to do it would be to create a static method that the camera script can call, IsMenuShowing() or something like that. Or a global variable. Another was would be for the menu to send a message to the camera when it activates or deactivates.

If you find that lots of objects need to know when the menu is showing, you may eventually want to move to a messaging system.