Skip to content

Fix typo that may cause crouch to always be true#7

Open
NRJulian wants to merge 1 commit intoBrackeys:masterfrom
NRJulian:master
Open

Fix typo that may cause crouch to always be true#7
NRJulian wants to merge 1 commit intoBrackeys:masterfrom
NRJulian:master

Conversation

@NRJulian
Copy link

A typo in the if statement in line 67 may cause the crouch bool to always check true. This revision simply changes the (!crouch) in line 67 to the intended (crouch) so that the script works as expected. Thank you!

A typo in the `if` statement in line 67 may cause the `crouch` bool to always check `true`. This revision simply changes the `(!crouch)` in line 67 to the intended `(crouch)` so that the script works as expected. Thank you!
{
// If crouching, check to see if the character can stand up
if (!crouch)
if (crouch)
Copy link

@ertanturan ertanturan Jan 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The soultion brings a good fix . Accepting pull req. would solve the issue ...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a similar solution. @ATBrackeys this is a bug and should be addressed.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it was intended to check when the Parameter for crouch was false (the user/player stop holding the crouch input button) so then it could check if the PlayerObject could "stand up"

Still learning unity but adding something below as well as setting k_CeilingRadius to a lower float fixed my problem

Suggested change
if (crouch)
if (m_wasCrouching && !crouch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants