This is a slightly different situation than What I have been able to find. I want to press ‘m’ and open up a gui menu but disable camera movment in my multiplayer game. I am close but not quite there with it. I want to hit ‘m’ open the menu (which I have done) and hit 'm’again and close it. While the menu is open freeze the camera movements. Here is what I have:
var openMenu : boolean = false;
var mouseMove : boolean = true;
function Update () {
if (networkView.isMine){
if (mouseMove == false)
{
myCamera.GetComponent("MouseLook").enabled=false;
}
if (Input.GetKeyDown ("m"))
{
openMenu=!openMenu;
mouseMove = !mouseMove;
}
}
I am not sure how to enable and disable off of just one button. Thanks for the help guys!