- Home /
Disable Mouse Look Through Script?
Hey Everyone. My friend wants to disable the MouseLook script for for a certain number of seconds, and I can get it to work. Well, partially to work. It disables for me to look up and down, but not from left to right. How can this be fixed? Do I have to add a Vector3 to it to disable all functions of mouse look? The code is provided below.
GameObject.Find("MainCamera").GetComponent(MouseLook).enabled = false;{
yield WaitForSeconds(10); GameObject.Find("MainCamera").GetComponent(MouseLook).enabled = true;}
Answer by A3tra3rpi · Jan 03, 2015 at 05:35 PM
When you move your mouse left or right your character turns. That is handled by another mouseLook in your character(in parent of Main Camera). You can disable it same way. Just use gameObject.GetComponent().enabled = false; (if your disable script is in character)
Ah! I should have thought of that! Seems like a simple mistake! Thank you! :)
Your answer
Follow this Question
Related Questions
Unable to disable the MouseLook script 2 Answers
Script to disable MouseLook? 2 Answers
How do I disable The MouseLook script when "I" is pressed. 3 Answers
disabling a script (MouseLook) 5 Answers