Horizontal Drag, no Vertical Drag

Hi, I was wondering if it’s possible to have different values for the drag of a rigid body, I’m currently moving a character using

rigidbody.SetVelocity

Using high drag my character doesn’t slide around but this means if my character jumps it doesn’t fall at free fall speed which I would like.

Doesn’t anyone have a solution to this?

Thanks

The best solution is to backoff the drag setting and instead keep your objects from moving around by assigning the right physic materials to the colliders.

http://docs.unity3d.com/Documentation/Components/class-PhysicMaterial.html

You might get what you want just by upping the setting for gravity to compensate for the friction. Go to Edit > Project Settings > Physics and set the ‘Y’ value for gravity to a larger negative number.

Alternately you could play with doing your own drag. Here is a simple version. Set the drag in the Rigidbody back to ‘0’ and then place the following two lines in FixedUpdate():

rigidbody.velocity.x *= 0.985;
rigidbody.velocity.z *= 0.985;

If you are writing in C#, you will need to use a temporary variable for this calculation and then assign the result back.