CaydenJessen / Stay-Hidden_GAME

Game Repository for CRE311
0 stars 1 forks source link

Infinite Jump Bug #6

Closed AndyLee-SH closed 1 month ago

AndyLee-SH commented 1 month ago

Describe the bug When Player use the Hide skill and press jump, they are able to continuously jumping up as long as those buttons are being spammed. Infinite jump also happens when the player is touching the left side of the wall while activating the jump and crouch button.

To Reproduce Steps to reproduce the behaviour:

Player use the hide skill Player jumps at the same time Player continue to press those buttons and it will make the Player go up the screen until they stopped pressing those buttons.

Player stands next to the left side of the wall Player use the hide skill Player jumps at the same time Player continue to press those buttons and it will make the Player go up the screen until they stopped pressing those buttons.

Desktop (please complete the following information):

OS: Windows 10 Unity Version 2022.1.7

CaydenJessen commented 1 month ago

To fix the infinite jump when the player spams both crouch and space I added an onGround boolean. This groundcheck checks if the player is in the air. I originally had a canJump which acted as a ground check but by also adding this bool it fixed it and made it so the player couldn't jump while in the air. It worked where if onGround == true, canJump = true.

To fix the bug where the player is able to jump infinitely when touching the right side of a wall Ying changed the player hitbox to the bottom of the sprite.