Answer by kennypu
this would be better:if(Input.GetKeyUp(KeyCode.Escape)) GetComponent("MouseLook").enabled = !GetComponent("MouseLook").enabledwhat that does is it'll flip the true and false. so if its true, it'll be...
View ArticleAnswer by Jessy
There's not much that's right about that script. Try this instead, and let us know if that's what you're talking about.function Update () { if (Input.GetKeyUp(KeyCode.Escape)) { var mouseLook =...
View ArticleAnswer by IBDelta
I think what these fine people fail to realize is that the FPS controller has two MouseLook scripts attached, one only appears to control the vertical for some strange reason I may never fully...
View ArticleAnswer by goldkillerv
function Update() { if (Input.GetKeyDown ("Esc")) { GameObject.Find("First Person Controller").GetComponent(MouseLook).enabled = false; } else { GameObject.Find("First Person...
View ArticleAnswer by tenukii
Example code for a main menu that toggles on escape key and turns off mouse look in C#. Of course you have to traverse whatever object hierarchy you have, not just blindly copy/paste. *ps: Their are...
View Article