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 RGravity · May 12, 2012 at 11:43 AM · collisionphysicsoncollisionenter

OnCollisionEnter called once even with multiple contacts

I have a complex mesh which has multiple contact points for it to rest on the terrain, however it only calls OnCollisionEnter once when the first contact point hits the ground, when the other piece hits the ground nothing happens. The mesh is a piece of twisted metal like from a wreck.

I need this to play a sound when the object collides so it seems unrealistic when the other contact point hits and no sound is heard. The ground objects and the craft are both using mesh colliders with convex set to true.

Does anyone have an idea how I can fix this?

Thanks.

Comment
Add comment · Show 1
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 RGravity · May 14, 2012 at 09:01 AM 0
Share

No one knows huh - is this even the right place to be asking this question? I'm amazed no one else has had this issue.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by syclamoth · May 14, 2012 at 09:04 AM

This is the right place- it's not your fault it's not as busy here as it should be. You are right- OnCollisionEnter only activates when the collision begins, however, the collision is kept track of in the physics engine. Try tracking individual contact points in 'OnCollisionStay' to manage your hit effects.

Comment
Add comment · Show 2 · 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 RGravity · May 14, 2012 at 09:22 AM 0
Share

Ok cool, thanks for the answer. I guess I dismissed OnCollisionStay because I didn't want sounds to be playing continuously but of course I can fix up the logic to prevent that if I can measure the relative force of contact points etc. I will look into it and post a reply if I can get it to work.

Thanks again.

avatar image syclamoth · May 14, 2012 at 09:23 AM 0
Share

You can't exactly measure relative force, but you can, for example, assume that if there are two contact points very close to one another in consecutive framse, they are the same contact. Come to think of it, this is a feature I should add to my material interaction system...

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

OnCollisionEnter event seems to be called late. 3 Answers

OnCollisionEnter inside FixedUpdate? 1 Answer

Changing transform.localScale but OnCollisionEnter isn't executed 1 Answer

Collision Query 1 Answer

Location of RigidBody2D on collision 3 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