• 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 Squalol · Oct 24, 2016 at 02:15 PM · rigidbodyaddforcerigidbody physics

Make gradual acceleration with drag.

Im making a top-down game where you control a spaceship. Your spaceship has a rigidbody and with W/S you increase/decrease the thrust (from 0 to 1) and every fixedupdate i do this: rb.AddForce (transform.forward * shipStats.acceleration*thrust); Im also forced to use at least a drag of 0.7 because i dont want the ships to "slide" when you turn (they work more like an atmospheric fighter than a spaceship). The problem comes with the big spaceships, if i put a low enough acceleration so that it slowly increases its speed and doesnt reach max speed in 1 second, it wont ever reach max speed because of the drag. If i give it a high enough acceleration so that it can overcome drag and reach max speed, it will just reach it in 1 sec.

I've thought about making each ship modify the "thrust" value at different rates, for example fighters give thrust +0.1 when you press "W" and big ones only give +0.01 so that they take longer to reach max thrust and therefore seem like they slowly accelerate but i feel like there might be an easier way.

TLDR: I have a rigidbody with max speed of 50 and drag of 0.7. Atm if i give it enough "addforce" to be able to reach max speed, it gets to it in just 1 second, but if i lower the addforce value it wont ever reach it cause of the drag. Is there a simple way to make addforce ignore drag at high speed while still keeping drag to not slide on turns?

Comment
Add comment · Show 1
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 Squalol · Oct 24, 2016 at 02:34 PM 0
Share

Another problem i found with each ship having a different thrust rate, is that even tho it takes longer to get to max thrust, once you are there, it already has max acceleration, so the speed lost on turns is almost inmediately regained since although the speed decreases on turns, the thrust doesnt.

0 Replies

· Add your reply
  • Sort: 

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Rotation problem with spawning bullet 2 Answers

How could I use AddForce() towards another Object without using transform.forward 1 Answer

Add force once when object is created 1 Answer

Method for giving a ball momentum through a swipe 0 Answers

Speed of the flying projectile (using forces) 1 Answer


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