[Tooltip("Represents how fast gravityContributionMultiplier will go back to 1f. The higher, the faster")]publicfloatgravityComebackMultiplier=15f;
[Tooltip("The maximum speed reached when falling (in units/frame)")]publicfloatmaxFallSpeed=50f;
[Tooltip("Each frame while jumping, gravity will be multiplied by this amount in an attempt to 'cancel it' (= jump higher)")]publicfloatgravityDivider=.6f;
[Tooltip("Starting vertical movement when falling from a platform")]publicfloatfallingVerticalMovement=-5f;
privatefloatgravityContributionMultiplier=0f;//The factor which determines how much gravity is affecting verticalMovement
privateboolisJumping=false;//If true, a jump is in effect and the player is holding the jump button
privateVector3inputVector;//Initial input horizontal movement (y == 0f)
privateVector3movementVector;//Final movement vector
privatefloatrotationSensitivity=.02f;
privatevoidAwake()
{
//-5f is a good value to make it so the player also sticks to uneven terrain/bumps without floating.