• 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 Harko33 · Jun 08, 2012 at 09:23 PM · rigidbodyforce

AddForce (or ConstantForce.relativeForce) and values like mass, drag, etc...

Hi all,

New to Unity, I go through some tutorials. And I noticed something : in a lot of tutorials, when an object is moved with RigidBody.AddForce (or ConstantForce), the value of this force is often multiplicated with the drag, mass, gravity, etc...

Why such a multiplication ? Doesn't a RigidBody automatically take these values into account when applying the force given in parameter to AddForce() ?

Thanks for lighting me :)

Comment
Add comment · Show 2
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 rutter · Jun 08, 2012 at 09:28 PM 0
Share

Hard to say without seeing some specific examples, but at first glance what you're saying sounds right to me.

It could be that those examples are trying to "compensate" for those values in some way, but that seems odd without knowing more about what exactly they're trying to do.

One thing you'll see, sometimes: it's fairly common to figure out how much force you want to apply (float), and then multiply that by some vector to project it in a particular direction.

avatar image Harko33 · Jun 09, 2012 at 12:15 PM 0
Share

I noticed that from that tutorials : http://www.youtube.com/watch?v=IYpwvtc0Fk8&list=FLHHuwhBBLwEdS5jkrwlv$$anonymous$$Tg∈dex=4&feature=plpp_video (part 1) http://www.youtube.com/watch?v=ssZ0BE7s9zA&list=FLHHuwhBBLwEdS5jkrwlv$$anonymous$$Tg∈dex=3&feature=plpp_video (part 2)

At the beginning of part 2 (about 2:09), the author explains how he makes the craft bounce. Basically, he takes the average of the five normals of his craft, and multiplies it by mass, drag, etc... The result is passed to constantForce.relativeForce. That's what I don't understand : why does he need that ? If i remove these values, the craft doesn't move, but the mass should make it go down, no ? I noticed that his craft has a RigidBody, but no Collider. $$anonymous$$aybe it's the clue ?

1 Reply

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

Answer by aldonaletto · Jun 09, 2012 at 03:50 PM

You should not worry about these "magic tricks" - from my experience, most programmers simply ignore physics basics and create random tricks just to make their projects work.
Unity's physics engine tries to emulate the real world physics - at least the most important stuff, like gravity, forces, mass, inertia, friction etc. AddForce applies a force to a rigidbody exactly like in real world, which produces an acceleration (a variation in velocity) equals to force / mass. If you multiply the force by the mass, you will get an acceleration equal to force mass / mass, or just force, what results in an acceleration numerically equal to the force applied - in other words, it applies an acceleration independent of the rigidbody's mass, exactly like gravity. Conversely, mass gravity results in the weight force, the force that pushes the rigidbody to the ground - it's useful to calculate a force that balances the gravity (for baloon physics, for instance), or to create an "artificial gravity".

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 Harko33 · Jun 10, 2012 at 08:04 PM 0
Share

Thank you very much. I understand much more now, it's clear :)

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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

Collider question 0 Answers

How to make a RigidBody move in a certain direction 1 Answer

Applying force to a rigidbody 2 Answers

How can Player or Enemy Generate Force to Push Rigidbodies? 1 Answer

Manually Apply Cars Collision Response Force 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