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 CoalCzar · Feb 13, 2014 at 02:58 AM · cursorshowhidden

Screen.showcursor = true won't work after Screen.showcursor = false

Hi,

I'm having the mouse visible during the start menu in my game. When I build the game and run it, the mouse shows up properly for the first time that you use the Start screen. After the Start screen, the cursor is hidden in the game. If you get through the level and return to the Start screen, the cursor remains hidden even though I need it to be visible.

I've tried to remedy this by putting

 Screen.showCursor = true;

in both the Start() and OnGUI() functions on an object in my Start level, but the cursor stays hidden.

Any help is appreciated. Thanks!

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by jasonkutty · Feb 13, 2014 at 05:44 AM

Please make sure that there are no other scripts that are constantly updating the Screen.showCursor as FALSE.

For example :

Script1 : function Update() { Screen.showCursor = false; }

Script2 : function ChangeCursor() { Screen.showCursor = true; }

See what I mean? If another script is updating every frame to disable the screen.showCursor, then enabling it in another script would not work....

Comment
Add comment · Show 5 · 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 CoalCzar · Feb 13, 2014 at 04:16 PM 0
Share

The only places in my entire solution that Screen.showCursor exists are in the Start scene's GUI script and in the Level1 scene's GUI script (separate scripts) Awake() function.

avatar image jasonkutty · Feb 13, 2014 at 09:51 PM 0
Share

Try changing it to the start function, and make sure it's not placed in any loops or update functions.

avatar image CoalCzar · Feb 14, 2014 at 04:59 PM 0
Share

It is in the Start() function in my Start scene and in the Awake() function in my Level1 scene.

avatar image jasonkutty · Feb 15, 2014 at 04:39 PM 0
Share

Hm... that's odd. Try the following :

1) create a new scene, and place the scripts in that. 2) see if it reproduces the same problem. 3) If it does, it's not Unity's bugs/glitches.

avatar image CoalCzar · Feb 26, 2014 at 05:37 PM 0
Share

I didn't change anything really, but somehow the darn thing works now, so I'm marking this as correct for your help. I really have no clue what happened.

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

19 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

Related Questions

Cursor not shown after changing scene 1 Answer

Why not showing up 1 Answer

Show Cursor in Menu 1 Answer

Standalone problem with cursor 1 Answer

How Can I Lock The Cursor Position? 1 Answer


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