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 jasonFHH · Apr 02, 2012 at 07:09 AM · inputlayersngui

How is click/touch input handled when using different layers?

Unity n00b here, just getting through the basics right now. I'm using NGUI to get my UI to render on top of a few 3D objects. I currently have two camera objects in my scene --- one that renders the 3D objects in the scene (cull mask set to "Default" layer, not "Everything"), and then the camera provided by NGUI.

I've put the NGUI root in a custom-declared "NGUI Layer" that I made. I applied this recursively so it also put the NGUI camera in this layer.

I made the standard camera object not include "Everything" but instead "Default".

Rendering-wise everything looks good, but I cannot click on the NGUI widgets, or detect hover events. It clicks fine if I keep everything in the same layer (but the rendering isn't how I'd like). I figure this must be a layer-related issue. Can someone explain to me how the basics of the layer-input relationship in Unity?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by gregzo · Apr 02, 2012 at 08:36 AM

From a post by NGUI's author on Unity forums, replying to a similar problem :

Edit -> Project Settings -> Physics, check "Raycast Hit Triggers".

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 jasonFHH · Apr 03, 2012 at 08:26 PM 0
Share

This did not work for me. I found "Raycast Hit Triggers" to be set already. I tried un-checking "Ignore Raycast" in the Layer Collision $$anonymous$$atrix in the "NGUI Layer" column, and that didn't seem to fix the fact that I can't click on anything. Any other ideas?

avatar image
0

Answer by jasonFHH · Apr 03, 2012 at 11:12 PM

I got a solution from ArenMook (NGUI creator) that seems to work. Click on NGUI's camera object, then in the script component for UICamera, change the Event Receiver Mask to match whichever layer you have your NGUI widgets on. That should make sure the right clicks/input is being received. Seems to work for me! More details here ---> http://forum.unity3d.com/threads/114833-NGUI-%28Next-Gen-UI%29-demo-amp-final-feedback-request?p=880566&viewfull=1#post880566

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
avatar image
0

Answer by icetear · Jan 31, 2013 at 03:21 PM

You have to make sure that in your UICamera the "Event Receiver Mask" ist set to the correct layer.

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.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Input behind 3d 2 Answers

NGUI KeyBinding Reversal? 0 Answers

NGUI with Leap Motion, or NGUI without mouse 2 Answers

Disable game logic related input when touching NGUI objects 1 Answer

NGUI UIInput issue with some Android devices (Virtual keyboard is OK, but no letters appears on textfield) 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