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 hangemhigh · Aug 03, 2014 at 02:07 AM · collisiondetection

Help with Circle Overlap Collision Detection

alt text

I want to find if two 3d object(round/circle) are Touching, if One is On Top of another or if it is Overlapping. I don't know where to start because collision detention wont work here. I am not looking for a code but if you can provide one, that would be awesome. I am just looking to see if Unity already has API to do this or if anyone got the idea of how to do this. Any help will be appreciated. Please look at the picture attached for more information.

overlapping.jpg (50.0 kB)
Comment
Add comment · Show 8
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 robertbu · Aug 03, 2014 at 02:10 AM 1
Share

The typical solution to this problem is colliders. If they are on the same plane, then a sphere collider or capsule collider will work. If they can be on different planes and/or can be rotated so that they are not parallel in the plane sense, you'll need to use a mesh collider that is simple enough that it can be marked as convex.

It can also be done mathematically with certain restrictions on how the circle is rotated.

avatar image hangemhigh · Aug 03, 2014 at 02:16 AM 0
Share

Wow I believe this is the same person that answered my last question :). I know about mesh colliders and thats what I planned to use but how can I do it with Oncollisionenter?

avatar image robertbu · Aug 03, 2014 at 02:29 AM 0
Share

I don't know you situation or your goals, but since you want to allow them to overlap, take a look at OnTriggerEnter() and OnTriggerStay() in the reference manual. Note that at least one of the circles will need a Rigidbody, though it does not need to move due to physics if you don't want it to. You need to set the isTrigger to true for the colliders.

avatar image hangemhigh · Aug 04, 2014 at 08:21 AM 0
Share

$$anonymous$$y goal is to make each model to be on the floor then detect if one is overlapping another one. OnTriggerStay is what I am currently using but that doesnt tell it when it is overlapping. It only says when it is touching while no longer moving...

avatar image robertbu · Aug 04, 2014 at 08:30 AM 0
Share

I'm not sure I have the nuances of this situation. Just reduce the size of the collider so that the edge of the collider is on the inside of the ring. Then you won't get the OnTriggerStay() until the rings overlap.

Show more comments

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

2 People are following this question.

avatar image avatar image

Related Questions

Hand-Held Weapon Collision Detection Not Working (going through walls) 1 Answer

How do I make OnTriggerEnter() respond to just one collider? 2 Answers

Test if BoxCollider is within another BoxCollider? 4 Answers

How can I destroy my Player when it touches another object? 1 Answer

How to set circle collision detectors more accurate 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