- Home /
Default First Person Controller; turn off mouse look, view still moves
So Ive attached a script to the default first person controller prefab, and i'm using var mouseLook : MouseLook;
and mouseLook = gameObject.GetComponent(MouseLook);
to retrive the MouseLook
script, which then, later in the script, i use mouseLook.enabled = false;
to disable the mouse look. Turning side to side is disabled perfectly, but i can still look up and down with no side to side rotation. I was wondering how to fix this as i'm using it to freeze the character without freezing the game so that the player can click some buttons.
I'm getting the exact same problem, if it's any consolation...
There are two $$anonymous$$ouseLook scripts : one on the player; one on the camera.
Answer by sengel · May 04, 2014 at 06:42 AM
alucardj got it. You have to disable the MouseLook on the camera. I used a simple
private MouseLook[] mous;
mous = GetComponentsInChildren<MouseLook> ();
mous[0].enabled = false;
mous[1].enabled = false;
kinda thing. mous[0] will be the charactercontroller MouseLook, and mous[1] will be the MainCamera MouseLook.
Your answer
Follow this Question
Related Questions
First Person Controller won't mouselook. 2 Answers
How to disable MouseLook in ingame pause. 1 Answer
How can I use only keyboard in FPC? 0 Answers
Why wont my camera controller work,Why isnt my script working for a camera controller? 1 Answer
Standard Asset FPS Controller: Unlock Cursor / Show Cursor for Menu 0 Answers