Jump Height not Constant

My character is not jumping constantly.
Sometimes it is jumping higher and sometimes it is jumping very low.
What could be the problem?

void OnJump(InputValue value)
    {
        if(value.isPressed)
        {
            float jumpAmount = jumpSpeed * Time.deltaTime;
            myRigidbody.velocity = new Vector2(myRigidbody.velocity.x, jumpAmount);
        }
    }

Hi CrazyGamer,

Have you already tried to remove Time.deltaTime? If not, try that and test your game again. Did this fix it?


See also:

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

Privacy & Terms