1
\$\begingroup\$

I'm following a tutorial to make a horror game. In the 8th tutorial I got stuck with the Mouselook option, he is using an other version of unity and I'm using Unity 5.

In Unity 4, MouseLook was a script attached to FPController, but in Unity 5, MouseLook has changed to become a part of FPController Script (in C#) as an object.

Now I need to access that, how to do that?

The file I am using is here: http://ryandome.weebly.com/ (named pausemenu.js)

And the error is in line 238 where it's unable to get the FPS controller's Mouselook option:

firstPersonControllerCamera = gameObject.Find("First Person Controller").Find("FirstPersonController");
print(firstPersonControllerCamera);
mainCamera = gameObject.FindWithTag("MainCamera").GetComponent("MouseLook");
firstPersonControllerCamera.enabled = false;
mainCamera.enabled = false;
\$\endgroup\$
1
\$\begingroup\$

To disable the Mouselook for a pause menu it surely doesn't matter if you disable the fps controller script instead of just the Mouselook script so you could try doing that using similar code to what's already there.

Instead of getting the fps camera and then the mouse look component you could get the fps controller script and then disable that.

\$\endgroup\$
0
\$\begingroup\$

The MouseLook is still a separate script in Unity 5. Search for MouseLook in the hierarchy. It's written in c#, but it's fairly simple.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.