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

Ladders not working with moving platforms #61

Open
arthursb opened this issue Jan 5, 2017 · 1 comment
Open

Ladders not working with moving platforms #61

arthursb opened this issue Jan 5, 2017 · 1 comment

Comments

@arthursb
Copy link

arthursb commented Jan 5, 2017

Hi,

I've been trying to use moving platforms and ladders in the same scene. I found that when Moving Platforms Layer is set to Moving Platform and my characters is on ground, it cannot climb the ladder.

If I jump and climb it, things work fine, but if I'm touching the ground, it seems like the character keeps constantly entering and leaving freedom state.

I've tested a few things and I think the problem is somewhere around these lines in function CheckGround, in PlatformerMotor2D.cs:

if (closestHit.collider != null)
{
    surfaces |= CollidedSurface.Ground;

    if (IsUserHandled())
    {
        FreedomStateExit();
        DisableRestrictedArea();
    }

    if (_collider2D.bounds.center.y - closestHit.centroid.y < minDistanceFromEnv || forceDistance)
    {
        transform.position += (minDistanceFromEnv -
        (_collider2D.bounds.center.y - closestHit.centroid.y)) * Vector3.up;
    }
}

What should I do?

(Attached a video demonstrating the issue)

Ladder issue.mov.zip

@h-shokri
Copy link

h-shokri commented Jul 6, 2017

Unfortunately, I have exactly the same problem.

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

No branches or pull requests

2 participants