var CursorLocked = true;
function Update()
{
if (Input.GetKey(KeyCode.Escape))
CursorLocked = false;
else
CursorLocked = true;
Screen.lockCursor = CursorLocked;
if(CursorLocked == false) {
GetComponent("MouseLook").enabled = false;
//disable begge mouse look scripts af spilleren
}
if(CursorLocked == true) {
GetComponent("MouseLook").enabled = true;
//disable begge mouse look scripts af spilleren
}
}
This is what I have got. It works, kind of… I’m trying to make it so if mouselook is false so is mouselook. Thing is, it only sets CursorLocked to false if you hold down Escape?
Side note: I have 2 mouselooks, one on camera one on player prefab, how would I get to the child camera of the player to disable it’s mouselook? I cant get this to work since I dont know what is going on and what to search on google. Any help appreciated, thanks.