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

Ladder collision fixes and buffer timer #117

Merged
merged 4 commits into from
Mar 13, 2024

Conversation

FailSpy
Copy link
Contributor

@FailSpy FailSpy commented Mar 13, 2024

Whilst doing the last-minute fixes on PR #114, I realized there's a couple of issues with the ladder system that while avoidable with good collision shape placement, it's probably easier to implement these fixes:

  • When stepping on the ladder, you have a half second cooldown (configurable) before checking if you're on the ground and you should "step off" the ladder. This makes it so if you're just stepping on to the ladder, you can't accidentally register as "on ground" and immediately come off it. The idea is the player will move within that .5 seconds, and the ground check will have changed.
  • In the ladder class, you can configure a "ladder collision" object. If this is set, it will disable the collision object whilst the player is on the ladder, and then set it back to whatever it was when the player comes off it. This prevents the collision object from blocking the player from going up/down the ladder if the player's collider isn't snapped perfectly.

Made this as a separate PR just to make sure these changes get their own chance for review.

You can see the issues with this on main by attempting to go down the ladder in the COGITO_01_Demo scene, which is fixed in this PR.

Copy link
Owner

@Phazorknight Phazorknight left a comment

Choose a reason for hiding this comment

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

player.gd:
Could the variables that were made explicitly typed be added back in? This might've just been an overlap of your PR as well as the other PR that added explicit types to player.gd

line 107: float
line 108: bool

Otherwise ladder behavior feels definitely better and snappier, especially when climbing down!

Comment on lines 107 to 108
const LADDER_JUMP_SCALE : float = 0.5
var ladder_on_cooldown : bool = false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@FailSpy FailSpy requested a review from Phazorknight March 13, 2024 21:08
Copy link
Owner

@Phazorknight Phazorknight left a comment

Choose a reason for hiding this comment

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

Thanks! looks good!

@Phazorknight Phazorknight merged commit bde8798 into Phazorknight:main Mar 13, 2024
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.

2 participants