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 rosdi · May 06, 2014 at 05:24 PM · unity 2dmouseunity 4.3.4

Unity 4.3.4 2D mode, hide mouse pointer only works on half of the screen

I am starting Unity3D today, but I am familiar with C# though.

I am following a 2D game tutorial at Udemy.com, and I am trying to hide the mouse cursor.

So I did this,

     // Use this for initialization
     void Start()
     {
         Screen.showCursor = false;
     }
 
     // Update is called once per frame
     void Update()
     {
         Screen.showCursor = false;
     }

But the mouse cursor is hidden at about half of the screen only (on the left side). If I move my mouse to the right the mouse pointer appears, if I move back to the left the mouse pointer disappears.

I am thinking this must be related to the way I setup my camera or view or something, any ideas what I should look at?

Update 1: Looks like the mouse is hidden at certain rectangle area of the screen but not the others. My initial description (half of the screen) is not accurate.

Update 2: I know what is happening now, it depends on the screen resolution I select!. If I select 800x600 then only a certain portion of the screen will the mouse get hidden. If I select Free Aspect then almost all the screen area will work as intended. See screenshot.

But I don't know whether it is a bug in Unity game player or my code. I assume it is a bug in the player since I have not done much coding at all.

alt text

resolution.jpg (103.8 kB)
Comment
Add comment · Show 5
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 ThePunisher · May 06, 2014 at 05:57 PM 0
Share

Search the project for other areas that have Screen.showCursor = true; and make sure there isn't something else turning it on.

avatar image rosdi · May 06, 2014 at 06:12 PM 0
Share

ThePunisher, the only code I have is the above. The rest are just game objects. I updated my question to reflect my finding so far.

avatar image ThePunisher · May 06, 2014 at 06:27 PM 0
Share

Can you take a screenshot? I'm running the same code you are and I am not able to reproduce anything similar.

avatar image rosdi · May 07, 2014 at 03:32 AM 0
Share

I include a screenshot now. It is due to the screen resolution I selected. So is this a bug in the player or I need to fix something in my code to make it work correctly?

avatar image ThePunisher · May 08, 2014 at 04:19 PM 0
Share

Don't think I've ever seen anything like that. Have you tried making a standalone build to ensure it works correctly there? Also, what happens if you don't maximize on play (top right)?

0 Replies

· Add your reply
  • Sort: 

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

21 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

Related Questions

Inconsistent Mouse Related Behavior in 2D 1 Answer

Restricting the mouse cursor from entering a certain area 0 Answers

How to convert mouse input to mobile touch in unity 1 Answer

Clicking again does not place object 1 Answer

Unity 2D: move towards mouse and through mouse 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