• Unity
  • Services
  • Made with Unity
  • Learn
  • 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
  • Forums
  • Answers
  • Feedback
  • Issue Tracker
  • Blog
  • Evangelists
  • User Groups

Navigation

  • Home
  • Unity
  • Industries
  • Made with Unity
  • Learn
  • Community
    • Forums
    • Answers
    • Feedback
    • Issue Tracker
    • Blog
    • Evangelists
    • User Groups
  • Get Unity
  • Asset Store

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 · mouseunity 2dunity 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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.

Follow this Question

Answers Answers and Comments

22 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

Related Questions

Unity 2D: move towards mouse and through mouse 1 Answer

Get object at mouse position? (UI) 0 Answers

c# unity area selection 0 Answers

Character moving to mouse in third person camera 0 Answers

Mouse rotation, jerky movement 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges