- Home /
Disable Mouse Look(script) completely
Hey guys and gals,
I have made a script that once a button is pressed it opens a map and once that map is opened, I disabled all player movement scripts so that the player has to stand still to look at the map EXCEPT, even after disabling the "Mouse Look(script)", the player is still able to move the mouse view up and down(but not side to side and etc. The script is disabled in the inspector but how is it still working and how do I fix this so that it doesn't move at all?
Thanks.
By the way, here is my shortened script: (variable messed up from this thread!)
var camera1 : GameObject; //player's camera var camera2 : GameObject; //Camera for the top down map var maplight : GameObject; //light used for "nightvision" for the map var flashlight : GameObject; //player's flashlight var mKeyDown : boolean = false; // True/False for keypress var player : GameObject; //don't mind xtra vars**
function Start () { // Call functions on startup of scene/game!
Screen.showCursor = false;
}
function Update(){
if(Input.GetKeyDown("m")){
if(mKeyDown){ // this means if (mKeyDown == true)
mKeyDown = false;
GetComponent("CharacterMotor").enabled = true;
GetComponent("MouseLook").enabled = true;
GetComponent("FPSInputController").enabled = true;
Screen.showCursor = false;
}
else {
mKeyDown = true;
GetComponent("CharacterMotor").enabled = false;
GetComponent("MouseLook").enabled = false;
GetComponent("FPSInputController").enabled = false;
Screen.showCursor = true;
}
}
}
I'm sure this code is fine, as it partially disables the MouseLook script, but not completely, so I'm thinking it's that script causing the problem.
Did you delete this question? There are 2 $$anonymous$$ouseLook scripts on the FPC, one on the capsule collider and one on the main camera. You need to disable both =]
And please format your code. . You can do this by highlighting all your code, then clicking the 10101 button at the top of the edit window.