• 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 Cranke · Jan 11, 2016 at 02:51 PM · 2dresolutionevent triggering

Multiple monitors lead to untriggerable events in Unity application ??

The Problem: I have a VERY simple project with an image and a PointerEnter event on that image. I seem to get some resolution-dependent results that I can't understand. I'd appreciate some help about why my PointerEnter event doesn't trigger on 1920x1080 resolution.

The Configuration:

  • Two monitors in Windows 10, setup in extended desktop mode.

  • The left monitor is 1600x1200.

  • The right monitor is 1920x1080.

  • If the program is run on the right monitor with a resolution greater than 1600x1200, the right-aligned image (or even a regular button) will not trigger events. No clicks. No PointerEnter/Exit. No button animations. Nothing.

The Results:

  • If I run this project in the Unity Editor and put my mouse over the image, I see in the log: "Pointer entered successfully!". All good!

  • If I build and run this project as a standalone .exe (Windows) on the right monitor at 640x480 resolution, I see in output_log.txt the same "Pointer entered successfully!" log entry.

  • Now, if I build and run this project as a standalone .exe on the right monitor at 1920x1080 resolution, I don't get the pointer entered log. It seems as if the pointer entered event just never fires at all.

The Project:

  • Create a new 2D project (Unity 5.3.1f1 Personal).

  • Create a canvas.

  • Create a panel on the canvas.

  • Set panel anchors to stretch/top, panel Height=50, and panel Pos y = -25.

  • Add horizontal layout group component to panel, uncheck child force expand width/height, and set child alignment to middle right.

  • Add image to panel.

  • Add layout element component to image and set preferred width and height to 50 each.

  • Add box collider 2D component to image with offset 0,0 and size 50,50.

  • Add event trigger to image that will call a simple script when PointerEnter happens.

  • In simple script, write Debug.Log to show that the PointerEnter event triggered successfully.

This is what it looks like: alt text

panel.png (3.1 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 Cranke · Jan 11, 2016 at 11:09 PM 0
Share

Another piece of information: The problem only happens when the image is aligned to the right side of the screen. If you ins$$anonymous$$d put the image on the left in the horizontal layout group, everything works as expected at 1920x1080.

$$anonymous$$an, what is going on here?

avatar image Cranke · Jan 12, 2016 at 04:08 AM 0
Share

Ok, I figured part of what is causing the problem.

I have two monitors with the desktop extended between them. When I have the second monitor enabled, the problem described above occurs. When I have the second monitor disabled, the problem goes away.

Still not clear on why that would be happening ...

avatar image Cranke · Jan 12, 2016 at 04:09 AM 0
Share

I have two monitors setup. The desktop is extended between them. They are basically side-by-side in the multi-display setup (such that going all the way to the left off of the main display will result in being on the secondary display).

avatar image Cranke · Jan 12, 2016 at 06:50 PM 0
Share

I ran the same test as above but replaced the image with a default button.

Same sort of results:

  • The button is visible.

  • The button cannot be clicked (trying to click it leads to no animation).

  • The button events do not fire (not button clicked event sent to script).

Seriously, someone must have encountered this before, no?

Also, choosing "windowed" mode during application launch fixes the problem. It only happens with fullscreen (non-exclusive) mode and a multi-monitor setup.

avatar image Cranke · Jan 12, 2016 at 07:25 PM 0
Share

Further:

  • $$anonymous$$y left monitor, at 1600x1200, works fine when the application is run there in full screen.

  • $$anonymous$$y right monitor, when I bring the resolution down to 1600x1200, also works fine.

  • But, if the right monitor is higher than 1600x1200, the problem I describe here begins to happen.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Cranke · Jan 13, 2016 at 12:19 AM

Looks like the problem is related to the targetDisplay set for the overall canvas (in screen overlay mode). The targetDisplay is always set to Display 1 (instance 0). When this is the case, the problems I talk about above happen. If I set the canvas to be Display 2 (instance 1) (which, btw, is the display the program is actually running on), things go back to working again like magic.

If anyone knows why I pick Display 2 from the Display Resolution Dialog but canvas.targetDisplay ends up getting set to Display1, I'd be interested.

I've posted a follow-up question to figure out why the discrepancy and what I can manually do about it (link text).

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

50 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

Related Questions

Pixel Perfect in different resolutions 0 Answers

Physic function doesn't work in different resoultions 0 Answers

Why my 2D shadows have low resolution? 0 Answers

World space to pixel space accuracy 1 Answer

Camera fix with resolution 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