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 CactusSalad · Sep 04, 2019 at 11:05 PM · spritesbox collidermouseoverhitbox

How do I fix clashing box colliders on two separate sprites?

Hey everyone! I'm fairly new to using Unity and have learned a lot on how the program handles sprites, animation, and UI interaction. As of right now I'm building an app that will generate a random melody for you.


The problem I'm having is a little tough to explain, so I'll provide a video so you can see the problem. |
So, I have 2 objects that I need to work at the same time in order for it to be UI friendly.
1. The first object is a drawer that opens and closes, and inside has a bunch of buttons (sprites). As of right now I'm only using the button labeled "C" for debugging.
2. The second item is that button.
These both need a box collider around them since they have OnMouseOver() methods attached to their code. However, when I try to click the button in the drawer, the drawer closes and am unable to press the button anymore.


I know the problem is the Box Colliders clashing with eachother, but I haven't been able to find a video/unity answer that fixes this.


If any of you guys know a way to fix this, I would very much appreciate it. I'm sure this isn't the first time someone has mentioned this problem but again I haven't found one, so again I appreciate the help.
(Btw if you need my code, I'll provide pastebin links in the comments since last time the code block broke my code and smashed it into lines.)

Comment
Add comment · Show 2
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 Magso · Sep 04, 2019 at 11:21 PM 0
Share

Why would the drawer's collider be over the buttons? What angle is it viewed from?

avatar image CactusSalad Magso · Sep 04, 2019 at 11:30 PM 0
Share

The drawer's collider is not over the buttons, it's under. The drawers are drawn first, then the buttons on top. The angle should be straight on since it's a simple 2d app. The issue is when I go into the button's collider I'm no longer on the drawer's which causes it to close.

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.

Follow this Question

Answers Answers and Comments

114 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 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

Polygon2D colliders getting messed up by rotation 0 Answers

Is it possible to change the texture property of a material via Animation clip? 2 Answers

Proper/Standard way to create a top down / isometric sprite sorting solution 1 Answer

Sprite plane doesn't cast shadow on another sprite plane 1 Answer

How do you make ripples for character in water? 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