The scenario is: 2D, movement on XY. No Gravity, object has a drag value of .6 and has a force of vector.up * 5 being applied to it (FixedUpdate(),Forcemode.Force).
How would I calculate the terminal velocity or max velocity of this object ahead of time?
Looking at the normal formula, I don't really have a projected area of the object or fluid density in this case. I'm also not really sure if the rigidbody.drag value is the same thing as the Drag Coefficient in this formula.
i'm not very good at math, but you can limit the max speed of you rigidbody, so you know beforehand what it will be. Code is as simple as:
public float maxVelocity;
void FixedUpdate() {
if (rigidbody.velocity.x > maxVelocity)
rigidbody.velocity.x = maxVelocity;
//now for the reverse direction
else if rigidbody.velocity.x < -maxVelocity )
rigidbody.velocity.x = -maxVelocity;
}
Tested code, I use this to limit my AI chars from moving too fast.
Make a BehaviourScript with two parameters - terminal velocity and a threshhold.
In update, or maybe LateUpdate, check the rigidbody's velocity.
If it's within the threshhold, start increasing the drag.
Use InverseLerp with the ThreshHold value and the TerminalVelocity value to get the amount of drag you want to add - just make it go to one as it approaches the terminal velocity.
Expanding on my comment above...
Set the Unity body drag to zero and then calculate and apply your own drag forces - it's not too hard. Then you know the exact values used and can plug them into this equation