Making fall faster

I notice that the player falls (either from ledge or from a jump) kinda slowly, a bit like on the moon. Is there any way to make the falla little faster the closer to the ground? I did the following, but still not fully desired functionality because he falls too early. Need big brain power to figure this out.

public override void Tick(float deltaTime)
    {
        Move(momentum, deltaTime);

        stateMachine.ForceReceiver.SubstractVelocity(startingVelocity);

        startingVelocity = startingVelocity + 0.01f;

        Debug.Log(startingVelocity);

        if (stateMachine.CharacterController.isGrounded)
        {
            ReturnToLocomotion();
            return;
        }

        FaceTarget();
    }

in forcereceiver:


    public void SubstractVelocity(float subStractValue)
    {
        verticalVelocity -= subStractValue;
    }

The rate of fall is based on the Physics.Gravity. You can adjust the gravity settings in Edit/ProjectSettings/Physics/Gravity.
The default setting is Vector3(0,-9.81,0) which is supposed to approximate 9.8meters per second squared, which is the magnitude of earth’s gravity. Many have observed that this number may be a bit low within Unity itself. Try experimenting with the gravity to get a better fit for your game.

1 Like

With games (and cinema) I often see mention that

Physics with -9.8m/s² is often just not ‘realistic’ enough. Especially considering that we seldom bother to fine-tune every little thing. We slap a rigidbody on the component and hope for the best. That rigidbody has a default mass of 1 (which I believe we can equate to 1kg if we consider 1 unity unit = 1m), and we don’t do much in terms of drag. -9.81m/s² is the gravitational acceleration without any air resistance.

In Pixar’s ‘Brave’, Merida’s hair is simulated with gravity closer to that of the moon in order for it to behave ‘realistic’ enough. So, as @Brian_Trotter says, experiment. Changing the global gravity value will affect everything. If you find that to be unwanted, try adjusting the mass and rag, etc. It’s not always a good idea to make mass = 80kg for your character, but play around and find what looks good enough.

And keep a backup, just in case you end up wanting to scrub everything and start again.

1 Like

Thanks for the pointers @Brian_Trotter @bixarrio , I’ll mess around with gravity/mass to see if it helps.

In this course, we’re simulating gravity with the ForceReceiver. Mass and drag are not a factor, simply applying acceleration of -9.81…

You’re right. I got into a tangent about rigidbodies in general and forgot about the OP’s question. My mistake. I initially wasn’t answering the question, just supporting your answer.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms