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 Johninamsterdam · May 04, 2021 at 10:06 PM · physicsoncollisionenterphysics settings

Increasing unity calculation accuracy [solved]

[Edited title as it was solved]

Hi all

I'm trying to model the collisions of two blocks in unity, following this video by 3blue1brown: https://www.youtube.com/watch?v=HEfHFsfGXjs - the interesting finding (which I'm trying to model) is that the number of collisions between two objects 'traces out' the value of pi.

When I have the two cubes of mass 1 each, OnCollisionEnter correctly reports 3 collisions. When I change the mass of the cube on the right to 100 I get 31 collisions - which is again, correct. However when I change the mass of the cube on the right to 10,000 - I should get 314 collisions, but instead only 20 collisions are reported.

I've tried changing the value of the 'Default Contact Offset' in project settings / physics to a tiny value (e.g. 10^-15) and that increases the number of collisions to 167 - but further decreasing it doesn't increase the collisions beyond the 167 (curiously roughly half the correct answer, but I think that's a red herring as exactly half would be 157). I've also set collision detection on the rigibodies to be continuous, and have changed various other physics settings to no effect.

Is there another setting I should be changing to increase the accuracy or is this just a limit of Unity's modelling?

I've attached the files in case of use.

Many thanks for any help

John

link text

3blue1browntestunitypackage.zip (795 B)
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 unity_ek98vnTRplGj8Q · May 04, 2021 at 10:32 PM 0
Share

Your zip link doesn't seem to work for me... however one thing I noticed that you didn't mention was messing with the fixed timestep. Have you tried setting this to a very low value?

1 Reply

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

Answer by Edy · May 05, 2021 at 09:19 AM

Love that Youtube channel!
I'd also try increasing the physics simulation frequency and the solver iterations. That should provide more accurate results. These are the options in Project Settings:

- Time > Fixed Timestep = 0.001. This is a frequency of 1000 Hz, instead of the default 50 Hz.
- Physics > Default Solver Iterations = 128. Just a large number, but you can try any other values.
- Physics > Default Solver Velocity Iterations = 128. Same, just a large number.

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 Johninamsterdam · May 05, 2021 at 10:12 AM 0
Share

Ah perfect - that did the trick. Thanks!!!

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

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

Collision Query 1 Answer

OnCollisionEnter before Physic simulations? 2 Answers

Scaling down my model or scaling up the gravity 3 Answers

Make GameObject Independent of Editer Physics 1 Answer

How to achieve cross platform deterministic physics(Android , IOS) ? 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