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?
asked Oct 07 '10 at 05:20 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.
answered Oct 07 '10 at 05:40 PM