• 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
3
Question by Pedro Cau · Mar 17, 2011 at 01:19 PM · collisionphysicscarvehiclewheel-collider

Getting contact force between two rigidbodies

I would like to know if there is a way of getting the contact force (aka normal force in physics) between two rigidbodies. Not just in a case of a collision, but also when a rigidbody stands still on top of another rigidbody. I know in pure Physx that information is acessible for use, but in unity I counldn't figure out a way to access it.

I'm needing it to correct the slip-based model for the wheel colliders the physx uses, because as I understand, the model takes the slip between the wheel and the road to calculate the friction force, but doesn't take in account the normal force between both. The result is that the friction can get the same values both on a horizontal floor, or on a ramp, and even on a wall. Just a slight contact can get full friction force.

So my idea to solve this was multiplying the stiffness factor by the normal force between the road and the wheels.

So that is the problem. Anyone has any idea? Or a diferent approach on solving this? What I need is a more realistic wheel behavior for my game, so the vehicle stop climbing mountains =P

Thanks in advance! =)

Comment
Add comment · Show 3
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 AngryOldMan · Mar 17, 2011 at 01:58 PM 0
Share

if you have a character controller on your vehicle you can set it's slope offset limit which means it will stop climbing mountains, might be worth adding that as a hardstop for your vehicle, as well as altering the wheel physics to get it looking how you please.

avatar image hellcats · Mar 17, 2011 at 03:56 PM 0
Share

I too have wanted access to the current force and torque accumulators on the rigidbody. I am currently just using a wrapper to keep track of this myself, but obviously this misses forces that don't know about the wrapper. Note that you would still miss impulses since these modify the velocity immediately rather than being accumulated in a force vector.

avatar image Pedro Cau · Mar 20, 2011 at 10:04 PM 0
Share

I'm starting to think that there is no way to solve this =(

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Edy · May 20, 2011 at 08:55 PM

 WheelHit.force

However, the force (and thus the friction) depends on the surface's own inclination. If you are climbing mountains the angle between the WheelCollider and the surface's normal is still around 0, so reducing the grip according to this angle wouldn't change the result.

But as the terrain becomes more inclined then the force will be reduced, thus reducing the grip as well. This should reach a point where the car can't climb further due to the low friction. So your problem seems to be caused because you're still using the default WheelCollider friction parameters. They denote a tire with almost infinite grip, so the car will climb anything. Just reduce the stiffness parameters (both forwards and sideways) to 0.01 - 0.04 and you'll get more real behavior.

Here you can see a demo of WheelColliders working properly:
http://www.edy.es/unity/offroader.html

Comment
Add comment · 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

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

1 Person is following this question.

avatar image

Related Questions

How can i import a new car in edy's vehicle physics? 2 Answers

Car Collision Damage 1 Answer

Need for speed like physics using Edy's vehicle physics? 1 Answer

Why does my car re-align after drift into the original direction? 0 Answers

audio fades 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