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
2
Question by jimbobuk · Feb 15, 2010 at 11:13 PM · physicscollidermeshiphone

How can I keep small dynamic physics objects from occasionally falling through a mesh collider?

I have a physics simulation where dynamic objects fall across a relatively complicated object represented by a mesh collider.

Generally everything is working fine, I've had my fair share of problems and dabbled with the fixed timestep to try and stop higher speed collisions from failing as an object passes through a surface in the space of one frame. I'm on Unity iPhone though so its not easy to give too much cpu time to the fixed updates.

I am getting a problem now where by every so often my dynamic objects will either fall straight through the mesh collider or occasionally settle for a while, and then fall through the mesh it was previously settling on.

I've been dabbling in the editor where i can even see this happening and notice that all i have to do is move the mouse across the dock to cause it to animate, the framerate drops in the editor to around 20fps and typically the objects will fall through the mesh collider.

I presume that the objects are managing to pass through collider again in a frame as the framerate is dropping so far, though surely the fixedupdate should be insulating it from this. I know there is a max fixed timestep that can be set, to a maximum of 0.3333 but what happens if this time limit gets reached, surely it shouldn't cause any issues.

Finally i know scale can play a role in this, the mesh collider is about 1m or so across, with the dynamic objects being about the size of a coin. I've heard the physics system's not meant to like smaller objects, but i decided to try and make the scale about lifelike so as to make gravity feel more correct.

I'm thinking now though that perhaps the size of the dynamic object is perhaps quite close to the largest distance it could move in a fixed update, perhaps this is causing it to be more likely to fall through a simple thin polygon more easily. I can't quite figure out if i increase the scale of it by say 10 or so, getting the dynamic objects closer to 1m then would the size of the object still have the same relationship to its maximum distance moved in a fixed update if i make the velocities match up by eye.

Beyond all this i wonder if trying to put a box collider floor underneath my mesh collider may be more of a failsafe as being less thin it should be far less likely to fall through in a frame.

What are people's strategies for handling this kind of problem? Especially with the CPU power of the iPhone.

Cheers

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

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by StephanK · Feb 16, 2010 at 12:26 AM

IMO the best strategy is to "reinforce" thin meshes or planes with extra, invisible colliders behind them, as you suggested, if that's possible. (Only possible with meshes where collisions do not occur on opposite sites.) Depending on how much colliders you have in the scene and how complicated the meshes are, you could also try to take this into your own hands and doing raycasts in an object's velocity direction and then check if the velocity is high enough, that in the next frame there would be a collision and react to it accordingly. Not very pretty, but if you don't have lots of objects this should work quite good.

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 jimbobuk · Feb 16, 2010 at 01:08 AM 0
Share

Thanks. I do wonder about doing this.

I also realise now that for the settled problem the size of the dynamic object/sphere may be important, ie. its far easier for a smaller object to pass through the super thin polygon where as a larger object would hopefully have more time intersecting the polygon to react. Though to make it look similar sometimes the gravity acceleration needs increasing as the scale increases. Not sure if the two were increased equally whether it would be any different at all? Usually you dont need to match the scale increase so i guess this is where the improvement is.

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

No one has followed this question yet.

Related Questions

How do i prevent an imported Mesh from falling through Terrain? 3 Answers

Colliders coming away from their parent object? 1 Answer

Physics collider behaving very odd on iphone 0 Answers

Is it normal for Unity to only show mesh colliders in green at runtime when they're static? 1 Answer

Rigidbody stuck in corners of Mesh Collider 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