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
0
Question by HolBol · Jul 14, 2010 at 05:41 PM · velocitycarfrictionwheel-colliderslip

Decreasing wheel friction with velocity

I want to have my car wheels to have less sideways friction at higher speeds, how do i do this? this is the code i have so far... but it doesn't work.

var slip = 0.022 - (rigidbody.velocity.magnitude / 150);

BackRightWheel.WheelHit.sidewaysSlip = slip;

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
3
Best Answer

Answer by spinaljack · Jul 14, 2010 at 05:50 PM

I'd change your code to:

var slip : float;

BackRightWheel.sidewaysFriction.stiffness = slip;

Also I'd clamp the slip value to make sure it never reaches 0 or some other minimum value.

To use math clamp you do this:

slip = Mathf.Clamp(slip,min,max)

or

slip = Mathf.Clamp(slip,0.001,0.022);

If you wanted a smooth curve instead of a linear line you can use this formula instead:

slip = 0.001 + 0.022/(rigidbody.velocity.magnitude+1) 
Comment
Add comment · Show 8 · 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 HolBol · Jul 14, 2010 at 08:00 PM 0
Share

Doesn' work... i get an error of : Assets/PlayerCar_Script.js(49,16): BCE0019: 'WheelHit' is not a member of 'UnityEngine.WheelCollider'.

avatar image spinaljack · Jul 14, 2010 at 09:09 PM 0
Share

That part's your code... Just delete that part

avatar image HolBol · Jul 14, 2010 at 09:12 PM 0
Share

AHHH so it is, woops.

avatar image HolBol · Jul 14, 2010 at 09:36 PM 0
Share

ins$$anonymous$$d of this: var slip = 0.022 - (rigidbody.velocity.magnitude / 150);, is there a better way to reduce it, but not too far? cos this goes into $$anonymous$$us numbers.

avatar image spinaljack · Jul 14, 2010 at 10:16 PM 0
Share

edited my answer

Show more comments

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

Detecting how much force is needed to bring a rigidbody's velocity to zero 1 Answer

How to make paddle influence ball motion in brickbreaker 0 Answers

Car not turning on plane. 1 Answer

How to make Physics2D more "stable" 0 Answers

Wheel Collider Stops Accelerating 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