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
1
Question by Destects · Jul 11, 2013 at 08:12 PM · physicsforceforces

Can someone explain how unity calculates forces because this just doesn't make sense.

Even with all units being generic, forces should still be calculated using the proper formulas, but unity seems to just throw logic out the window and use made up crap to calculate forces.

with a gravity of -10, I took a box (call it boxA) of mass 1 attached with a fixed joint to a box (call it boxB) fixed in space, i set the break force to 10, and slowly increased the mass of boxA until the joint broke. oddly enough a mass of ~16.0802 was needed to break to joint, to add to the strangeness, the reported breakforce (via onjointbreak) was an insane number in the billions (something like 1.065353E+09). This just doesn't make sense, unless that huge number is measured in microns or something it just doesn't make sense...

I know my physics, and this is just ... wtf?

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 Lockstep · Jul 11, 2013 at 08:47 PM

The reason for the late break is the forcemode, which is ForceMode.Force. This means the rigidbody gets accellerated over time rather than instantly. The joint breaks are made for explosion like forces rather than gradual ones.

I tested it myself and I was able to increase the mass to about 50, which matches my physics frame rate. When I applied forces via script using AddForce(*, ForceMode.Impulse) it worked like you would expect it.

In real life physics the force is mass time change of velocity over time. You calculate it for an infinitesial small time step. In computer physics however this is generally impossible. The smalles fraction of time we could deal with in unity is one (physics) frame. However it seems like the joints have been tweaked for a timestep of one second. Else the joint break was framerate dependant which is to avoid whenever possible.

For the debug message: I got the same thing even if I applied a force of 14 manually. I suggest you file a bug report for this one.

Comment
Add comment · Show 3 · 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 Destects · Jul 12, 2013 at 02:07 AM 0
Share

While I appreciate the strong and informative answer, It doesn't satisfy my question see as I'm not using AddForce. I've run this test by setting the mass, pressing play, and then stopping, changing the mass, and starting the scene again. It has nothing to do with ti$$anonymous$$g.

avatar image Lockstep · Jul 12, 2013 at 04:11 PM 2
Share

Gravity works a bit different from AddForce. For example: gravity won't wake a rigidbody up. The first test of $$anonymous$$e was using gravity too. I guess I should have made this more clear.

I had a rigidbody of mass increasing and a fixed joint with a break force of 10 and the default gravity of 9.81. According to my previous explanation, you need to apply a force which causes a change of velocity from 0 to 10 in one second. But this force must be applied in one physics frame.

In my first go, I had the default fixed timestep of 0.02 or 50 physics frames per second. Which means a per frame force of mass*gravity/50. Thus the break mass was about 50 which matched my experiment.

To double check I have set the fixed timestep to 1 which means one physics frame per second. This resulted in a per frame force of mass*gravity. As predicted the break mass was now slightly above 1. The experiment matched my predictions. If you want to repeat this you must keep in $$anonymous$$d that the physics framerate is only 1 and thus the rigidbody will only move once a second. So don't change the mass too quickly.

And yes, this means the joint break caused by gravity is dependant on the physics frame rate. However since the physics frame rate is fixed, this is a bit less of a problem than beeing regular frame rate dependant.

avatar image Destects · Jul 15, 2013 at 04:38 PM 0
Share

How strange. I mean, It makes sense, given that acceleration is distance/time^2 (m/s^2)and timestep is 0.02s/1s... mmm, In my $$anonymous$$d I'm thinking of real word physics, and that's probably why It seems so odd. I realize there's a reason for the calculation to take that into account, I just wish it used a double standard because why you want a timestep around 0.02 for smothness, calculations should be made with respect to real world time while behaving in game time... bleh, i'll just have to calculate all my numbers to match scale.

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

17 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

Related Questions

adding force 1 Answer

windszones 0 Answers

adding Up force 0 Answers

Rotational Force 0 Answers

Making a paper like object on Unity. 2 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