Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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!
@@ -64,7 +64,7 @@ private void FixedUpdate()
public void Move(float move, bool crouch, bool jump)
{
// If crouching, check to see if the character can stand up
if (!crouch)
if (crouch)
Copy link

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.

None yet

4 participants