Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
This question was closed Mar 24, 2018 at 04:20 AM by cydonia for the following reason:

Looking for help on Unity answers is like getting medical advice on Yahoo answers or gaming advice on 4chan /v/.

Will try again with a more concise and to the point question and hope I get a better answer than "you already know what needs to be done"

avatar image
0
Question by cydonia · Mar 21, 2018 at 03:32 AM · scripting problempause menumain menu

How to get the Cursor to be visible after returning to main menu.

Ok I'm trying to make a simple pause menu that lets the player return to the main menu. So far it does that however when the Main menu loads the cursor is locked and not visible.

I am using the standard FPSconteroller because I'm a beginner at scripting and simply "script your own!" is not an option.

here's the script i'm using.

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.SceneManagement;
 
 public class PauseMenu : MonoBehaviour {
 
     public static bool GameIsPaused = false;
 
     public GameObject pauseMenuUI;
 
         // Update is called once per frame
     void Update () {
         if (Input.GetKeyDown(KeyCode.Escape))
         {
             if (GameIsPaused)
             {
                 Resume();
             } else
             {
                 Pause();
             }
         }
     }
 
     void Resume ()
     {
         pauseMenuUI.SetActive(false);
         Time.timeScale = 1f;
         GameIsPaused = false;
     }
 
     void Pause ()
     {
         pauseMenuUI.SetActive(true);
         Time.timeScale = 0f;
         GameIsPaused = true;
     }
 
     public void LoadMenu()
     {
         Time.timeScale = 1f;
         SceneManager.LoadScene("Main Menu");
     }
 
     public void QuitGame()
     {
         Debug.Log("Quitting Game...");
         Application.Quit();
     }
 }


All I need to do is disable the FPS controller script or mouse lock script when I return to main menu.

Any help would be appreciated. The game is done beyond the pause menu, everything else worked but a simple pause menu is tripping me up, I JUST need to be able to return to the main menu with a functioning and visible cursor.

To sum up, how do I disable the mouse hide and lock script upon loading the main menu from a level and where in the code would I put such a command? Seriously if you have an answer show me where to put it, the scrip is useless if I don't know where it goes.

I know what needs to be done but I don't know how to do it.

Comment
Add comment · Show 1
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 cydonia · Mar 21, 2018 at 09:23 AM 0
Share

On a related note if you know of a simple script that allows for a canvas to be toggled on and off with a button click that would also be helpful.

1 Reply

  • Sort: 
avatar image
0

Answer by exzizt · Mar 21, 2018 at 10:09 PM

In the Main Menu scene, have Cursor.visible = true; somewhere.

Comment
Add comment · Show 4 · 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 cydonia · Mar 23, 2018 at 01:37 PM 0
Share

That doesn't work

The problem is the cursor lock script. That needs to be turned off.

Also I don't know where in the script to put that. I tried in the menu load section but it didn't work.

avatar image exzizt cydonia · Mar 23, 2018 at 11:05 PM 0
Share

Sounds like you already know what it is you need to do! :)

avatar image cydonia exzizt · Mar 24, 2018 at 03:56 AM 0
Share

I know what needs to be done I don't know how to do it. I know the cursor lock script needs to be turned off, I don't know how to do it.

It's like being lost, I know I need to go home, but don't know how to get there.

Show more comments

Follow this Question

Answers Answers and Comments

191 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Settings menu of main menu not updating in settings menu of pause menu. Unity C#, 0 Answers

game over and pause menu conflicting scripts 0 Answers

How to disable mouse lock script when returning to main menu 1 Answer

why does timescale not work? 2 Answers

Pause Menu Help 0 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