-
Notifications
You must be signed in to change notification settings - Fork 249
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
Can't ascend low hanging one-way platforms, possible fix included #43
Comments
That change was indeed a way to allow walking up a sloped one-way platform. Mike On Sat, Jan 3, 2015 at 4:09 PM, astrobread notifications@github.com wrote:
|
This is just from eyeballing the code so I could be missing something, but I don't think this change would impact one-way platform slopes. There are no meaningful collisions with one-way platforms while ascending in MoveVertically(). It only casts rays from the top of the collider in this situation, so anything it hits has nothing to do with what you're walking across. When ascending, this function's only job is to prevent you from cracking your head against solid platforms. What makes sloped one-way platforms work is already inside MoveHorizontally(), which uses similar logic to detect slopes from either kind of platform. Whereas the grounded check inside MoveVertically() only seems to prevent jumping onto one-way platforms |
You might be right. I'll do some rest with and without the check and make sure all is well. On Jan 4, 2015, at 4:50 PM, astrobread notifications@github.com wrote: This is just from eyeballing the code so I could be missing something, but I don't think this change would impact one-way platform slopes. There are no meaningful collisions with one-way platforms while ascending in MoveVertically(). It only casts rays from the top of the collider in this situation, so anything it hits has nothing to do with what you're walking across. When ascending, this function's only job is to prevent you from cracking your head against solid platforms. What makes sloped one-way platforms work is already inside MoveHorizontally(), which uses similar logic to detect slopes from either kind of platform. Whereas the grounded check inside MoveVertically() only seems to prevent jumping onto one-way platforms — |
If a one-way platform is placed just overhead of the character, they cannot jump completely through it.
To recreate place a one-way platform just above the player. They don't need to be touching, but it has to be close enough so that the initial jump velocity will collide them in the first frame of the jump.
Expected result is that the player passes through the one-way platform, then lands on it after the jump is complete. Observed result is that the player travels most of the way through the platform, then their jump ends much sooner than expected and they fall back to where they started.
This issue can be resolved by modifying this line in CharacterController2D.moveVertically:
If you remove the wasGroundedLastFrame condition the platform behaves as expected. Was this condition included to allow one-way platforms with slopes? Or is it for something else I'm not aware of?
The text was updated successfully, but these errors were encountered: