• 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 slkjdfv · Jul 07, 2010 at 11:42 PM · physicscarforce

realistic down force on a car?

How do i apply a down force(s) in the correct fasion. so the faster my car goes the more down force is applyed? I tryed rigidbody.AddForceAtPosition(vector3.up * -downforce,transform.position);

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 cncguy · Jul 08, 2010 at 03:59 AM 0
Share

what happened when you tried that. Is you downforce variable a function of the speed of the rigidbody?

avatar image fherbst · Jul 08, 2010 at 10:44 AM 0
Share

Ins$$anonymous$$d of AddForceAtPosition with transform.position as second parameter, you could try to use AddForce(Vector3.up * (-downforce)).

avatar image slkjdfv · Jul 09, 2010 at 11:27 PM 0
Share

well when i tried it nothing happened i think it flipped easier is all lol.

1 Reply

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

Answer by jonas-echterhoff · Jul 09, 2010 at 12:12 PM

Here's my "Wing" script from the alternate physics model in the Car Tutorial:

using UnityEngine; using System.Collections;

// This class is used to simulate aerodynamic wings or ground effects. // Add it to a node to have lift or downforce applied at that point. public class Wing : MonoBehaviour {

 // Cached rigidbody
 Rigidbody body;

 // lift coefficient (use negative values for downforce).
 public float liftCoefficient;

 // Get rigidbody.
 void Start () {
     Transform trs = transform;
     while (trs != null && trs.rigidbody == null)
         trs = trs.parent;
     if (trs != null)
         body = trs.rigidbody;
 }

 // Update is called once per frame
 void Update () {
     if (body != null)
     {
         float lift = liftCoefficient * body.velocity.sqrMagnitude;
         body.AddForceAtPosition(lift * transform.up, transform.position);
     }
 }

}

Comment
Add comment · Show 2 · 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 slkjdfv · Jul 09, 2010 at 11:27 PM 0
Share

AWESO$$anonymous$$$$anonymous$$ THX! I'll try this :D.

avatar image W.Walter · Jan 28, 2015 at 08:13 AM 0
Share

Should that physics code not be under FixedUpdate?

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

No one has followed this question yet.

Related Questions

Setting Wheelcollider BrakeTorque to 0 does not release brake 0 Answers

add force to object that has 2 different rigid bodies 0 Answers

Simple Rigidbody / force question 3 Answers

How to tumble player car on collision with enemy car? 0 Answers

add torque at position 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