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 /
avatar image
0
Question by gwentech · Mar 12, 2019 at 04:36 PM · event triggeringmultiple-monitorsmultiple cameras

(2) Cameras, (2) Displays, all UI events seem to go to one camera

Hello. I have (2) non-overlapping cameras on separate displays, separate canvases, separate UI elements and want button click events to call the script on the appropriate camera.

The problem: Instead, click events on either display call the script on one of cameras only. Changing 'depth' on the cameras chooses which one gets the events, but I want button click events to call the script only on the appropriate camera.

Do I have to abandon the editor-configured events and use something like ViewportPointToRay() (would that even work?), or is there a simpler way to fix this?

Thanks.

Comment
Add comment · Show 6
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 gwentech · Mar 14, 2019 at 05:21 PM 0
Share

(...anyone?)

avatar image xxmariofer · Mar 14, 2019 at 08:18 PM 0
Share

may i ask how are the events being called? are the buttons set up at runtime by code? if so can you share your code? i am not sure if i undestood 100% sorry if this has nothing to do with your question.

avatar image gwentech xxmariofer · Mar 25, 2019 at 04:38 PM 0
Share

Here is an example project that shows the issue.

https://1drv.ms/u/s!AjkOmmF8XhUUg711ZNemzRtQsHT7AQ

There are two cameras, two canvases, two displays, and two buttons. When user clicks the button on either display, display1 receives the event. If the depth is changed on either camera to exceed the other, events map to the associated display.

Again, the goal for me is to have events from elements on canvas1 to map to display1's camera. canvas2's element events to map to display2's camera.

Thanks.

avatar image gwentech · Mar 14, 2019 at 08:37 PM 0
Share

Thanks for your response. Events are set up in the editor prior to runtime, with the appropriate camera set as the onClick event object.

avatar image xxmariofer gwentech · Mar 14, 2019 at 08:49 PM 0
Share

i have tryed to replicate your case with 2 canvas 2 cameras (but one monitor i dont have 2) and the script are working fine, do you have a project that you can share with mein which it happens? also just to mention the canvas are set to screen space - camers render mode right?

avatar image gwentech xxmariofer · Mar 26, 2019 at 06:45 PM 0
Share

Here is an example project that shows the issue.

https://1drv.ms/u/s!AjkOmmF8XhUUg711ZNemzRtQsHT7AQ

There are two cameras, two canvases, two displays, and two buttons. When user clicks the button on either display, display1 receives the event. If the depth is changed on either camera to exceed the other, events map to the associated display.

Again, the goal for me is to have events from elements on canvas1 to map to display1's camera. canvas2's element events to map to display2's camera.

Thanks.

1 Reply

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

Answer by xxmariofer · Mar 27, 2019 at 12:23 PM

hello, you are missing 2 parts, you are never enabling the multidisplay thats dine like this

  Debug.Log("displays connected: " + Display.displays.Length);
  // Display.displays[0] is the primary, default display and is always ON.
  // Check if additional displays are available and activate each.
  if (Display.displays.Length > 1)
      Display.displays[1].Activate();
  if (Display.displays.Length > 2)
      Display.displays[2].Activate();

and remember, that you CANT test multidisplay from inside unity editor, so you will have to build the game or do some work arround. i have tested your project and adding those lines in the start (be sure you only do it once) and building worked for me

Comment
Add comment · Show 1 · 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 gwentech · Mar 28, 2019 at 01:41 AM 0
Share

Yes, my sample project neglected to Activate() the display. But you're right - the editor makes it look like you can test multi-displays, but you can't interact with it. In other words, you can see display2 correctly, but clicking anything puts the event on display1. I'll just build to test. Thanks for your help!

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

102 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

Related Questions

Multiple Display UI Issues 1 Answer

Main display hijacked after enabling Render Pipeline 1 Answer

Crashing in build version NOT in Editor 0 Answers

Multi-Display - Multi Touch Screen Issues 0 Answers

Unity running over multiple monitors 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