Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CharacterController2D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

@ertanturan ertanturan Jan 15, 2020

Copy link
Copy Markdown

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 ...

Copy link
Copy Markdown

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
Copy Markdown

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)

{
// If the character has a ceiling preventing them from standing up, keep them crouching
if (Physics2D.OverlapCircle(m_CeilingCheck.position, k_CeilingRadius, m_WhatIsGround))
Expand Down