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 Tuah · Oct 07, 2010 at 05:20 PM · velocitygravityforcequack

Keeping character's movement consistent.

I'm still working on my rigidbody character, trying to figure out the best type of force mode to use while moving it.

I basically want my character to move at a constant 10mph, allowing for outside things to act on him. A force blowing him backward at 5mph will bring him to a total speed of 5mph. But how would I keep such a constant speed?

I've tried all manners of AddForce(desiredVelocity,ForceMode.Force), using mass, time, and such.

When I try to make a capped speed to reach, it manages to reach it no matter what forces are acting against it.

I also haven't been able to figure a way around the "floaty physics" of my own gravity forces.

Anybody have a definitive solution to this?

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

Answer by Loius · Oct 07, 2010 at 05:40 PM

You need to keep the character from exerting more force than they're capable of - calculate how much force you need to get to 10mph, and if that's more than the character can exert, just add their maximum exertion instead of how much they calculated that they need.

Or, whenever a force is applied to the character (e.g. froma wind zone), tell the character that its base velocity is no longer 0,0,0, but is instead that force.

Comment
Add comment · Show 5 · 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 Tuah · Oct 07, 2010 at 05:48 PM 0
Share

That's what I'm trying to do. Assu$$anonymous$$g my character could instantly accelerate to his maximum force to bring him to 10mph, what function would I use to apply that?

After I find that out, I'll manually apply acceleration to where he can accelerate to said force.

avatar image Loius · Oct 07, 2010 at 06:37 PM 0
Share

I think you want Vector3.$$anonymous$$in( desiredForce, maximumForce )

avatar image Tuah · Oct 07, 2010 at 06:41 PM 0
Share

Would I apply that with AddForce(force,Force$$anonymous$$ode.Force)? force*mass*Time.deltaTime,Force$$anonymous$$ode.Force, or even force*mass,Force$$anonymous$$ode.Impulse?

avatar image Tuah · Oct 07, 2010 at 08:45 PM 0
Share

OH! I figured out my problem. I had $$anonymous$$ass set to 150!

avatar image Tuah · Oct 07, 2010 at 09:14 PM 0
Share

Edit: Just realized I'm back where I started. I'm going to try something else...

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

Impulse to reach certain height? 1 Answer

Gravitational Object Creation for 3D Game 1 Answer

rigidbody.Velocity stops gravity 2 Answers

Simulate gravity on rigidbody 1 Answer

Firing projectile in curve 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