I want to add coyote time to my jumping. I am unsure how I would be able to do it without messing my existing code. I would like to do it by setting a timer when the player touches the ground and then reducing that with Time.deltaTime.
Here is my current jump code:
// Changes the height position of the player (jump)
if (jumpAction.triggered && groundedPlayer)
{
playerVelocity.y += Mathf.Sqrt(jumpHeight * -3.0f * gravityValue);
animator.CrossFade(jumpAnimation, animationPlayTransition);
}
playerVelocity.y += gravityValue * Time.deltaTime;
controller.Move(playerVelocity * Time.deltaTime);