Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Gambit 3 · Mar 23, 2011 at 12:52 PM · mousepauselock

Mouse Look and Character Motor off but i can still see :( help plox?

hey guys :)

iv turned the Mouse Look and Character Motor scripts off, but i can still look up and down.

iv cut out the unimportant stuff but heres what im using:

var IsPaused : boolean = false;

function Start() { Screen.showCursor = false; };

function Update() {

 if (Input.GetKeyDown ("escape")){
     if (IsPaused == true){
         IsPaused = false;
         Time.timeScale = 1.0;
         Screen.showCursor = false;
     }
     else{
         IsPaused = true;
         Time.timeScale = 0.00001;
         Screen.showCursor = true;
     };
 };  

};

function OnGUI() { if (IsPaused == true){

     var ResumeButton : boolean = GUI.Button(Rect(Screen.width/2, Screen.height/2, 175, 20), "Resume Game");
     var VisitWebsite : boolean = GUI.Button(Rect(Screen.width/2, Screen.height/2 + 25, 175, 20), "Visit the Website");
     var QuitButton : boolean = GUI.Button(Rect(Screen.width/2, Screen.height/2 + 25 + 25, 175, 20), "Exit");

     GameObject.Find('Player').GetComponent('MouseLook').enabled = false;
     GameObject.Find('Player').GetComponent('CharacterMotor').enabled = false;

     if (QuitButton){
         Application.Quit();
     };

     if (ResumeButton){
         IsPaused = false;
         Time.timeScale = 1.0;
         Screen.showCursor = false;
     };

     if (VisitWebsite){
         Application.OpenURL("www.google.com");
     };

 }
 else{
     GameObject.Find('Player').GetComponent('MouseLook').enabled = true;
     GameObject.Find('Player').GetComponent('CharacterMotor').enabled = true;
     return;
 };

};

also the timescale does absolutly shit all (excuse the language) but every time i ask how to make a pause menu people always say to use timescale and it does absolutly nothing for me.

but this is pretty much a work around and i know it works.

the character cant move at all and you cant look around, the game still goes on so it isnt pausing really..its more for my interactives.

thing is, you can still look up and down and i dont know why. i tried unticking every script and it still does it.

help please :S?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

5 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Velketor · Mar 23, 2011 at 02:53 PM

make sure you are unchecking the scripts on the Character Controller, not just the scripts on the camera.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Gambit · Mar 24, 2011 at 02:01 AM

iv turned the Mouse Look and Character Motor scripts off

sorry it wouldnt let me login :L

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Daniel 19 · Apr 07, 2011 at 12:20 PM

I have the same problem! Have you solved it yet?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by haxard · Apr 06, 2012 at 09:35 PM

The Mouse Look script is on two objects: the First Person Controller, and the Main Camera that is a child of the Controller.

You're only disabling the one on the First Person Controller, which handles the X axis (MouseX). That's why you can still look up and down.

You also need to disable the Mouse Look script on the Main Camera, which handles the Y axis (MouseY).

Hope that helped

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by doomlazy · Jun 26, 2014 at 09:31 PM

Thank you haxard.

I made 2 scripts. One is called "PauseMenu.js" The other is called "PauseMenu2.js"

I have PauseMenu on my FirstPersonController and PauseMenu2 on my camera.


PauseMenu:

 var paused : boolean = false;
 var backgroundMusic : AudioSource;
  
 function Update () 
 {
    if(Input.GetKeyDown(KeyCode.Escape) && paused == false)
    {
        GetComponent(MouseLook).enabled = false;
        paused = true;
        backgroundMusic.mute = true;
        Time.timeScale = 0;
    }
    else if(Input.GetKeyDown(KeyCode.Escape) && paused == true) 
    {
        GetComponent(MouseLook).enabled = true;
        paused = false;
        backgroundMusic.mute = false;
        Time.timeScale = 1;
    }
 }



PauseMenu2:

 var paused : boolean = false;
 
 function Update () 
 {
    if(Input.GetKeyDown(KeyCode.Escape) && paused == false)
    {
        GetComponent(MouseLook).enabled = false;
        paused = true;
        Time.timeScale = 0;
    }
    else if(Input.GetKeyDown(KeyCode.Escape) && paused == true) 
    {
        GetComponent(MouseLook).enabled = true;
        paused = false;
        Time.timeScale = 1;
    }
 }



Hope This Helps!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Locking cursor/mouse on an object 1 Answer

Locking the Cursor at the center. 4 Answers

Mouse lock to target 0 Answers

menu issue and mouse click 0 Answers

Cant unlock cursor with FPS prefab 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges