Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
1
Question by mthicke2 · Dec 08, 2013 at 05:07 AM · collidertriggeronmouse

Can one click trigger 2 colliders?

I want onmousedown to be triggered on an 2 colliders, one on a parent object that encompasses the collider on the child. is this possible?

Comment
Add comment · Show 3
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 iwaldrop · Dec 08, 2013 at 05:47 AM 0
Share

Not without scripting some kind of scripted solution. But then you wouldn't need a child collider. You could do a Send$$anonymous$$essage, or roll a more efficient solution by just calling a method on a cached component.

avatar image mthicke2 · Dec 08, 2013 at 07:04 AM 0
Share

I have several game objects that are clickable parented together to an object with a collider to allow the user to pan across all of the objects. I want to set it up so that the objects can be clicked as well. I'm not sure I understand the idea of calling a method on a cached component.

avatar image iwaldrop · Dec 08, 2013 at 07:32 AM 0
Share

Are you building your GUI of just game objects, or are you using a third party GUI solution like ngui or ezgui?

If you want to be able to drag a collection of selectable things, have everything listen to the mouse/touch up event. When you drag your panel, simply tell all of the selections to ignore touch ups. When the draggable object gets it's mouse up, notify its children to allow selection again. You may have to delay the red able signal to the draggable panel's children by a frame.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by vikingfabian-com · Dec 08, 2013 at 07:55 AM

Ive got two ideas for your problem:

  1. Turn off the collider in the parent object and run a new raycast, that should pick up the child

  2. Let the child objects know what their parent is when creating them, and store it in a variable. Don't have any colliders on the parent object, the the children tell the parent about the click event.

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

18 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

Related Questions

OnMouseOver with multiple colliders 1 Answer

Can't click gameobject when over another trigger? 1 Answer

Something wrong with destroying script 0 Answers

Problem with the collider(I think) 0 Answers

How having correct bounce on a rotating pinwheel(it's more complicated)? 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