2D Character Controller tutorial leads to stuck on a corner

This leads to a problem where jumping at a box collider and landing on the top corner gets you stuck. Can’t walk toward the platform, and won’t fall; you only fall if moving away.

I’m using some semi-complex movement code:

    public float maxSpeed = 10f;

    void HandleInput() {
        // Walking left/right
        float move = Input.GetAxis ("Horizontal");
        float forceMultiplier = 0.1f;

        if (Mathf.Abs (rigidbody2D.velocity.x) < maxSpeed) {
            forceMultiplier = 5 * (1 - Mathf.Abs (rigidbody2D.velocity.x) / maxSpeed);
            if (!onGround)
                forceMultiplier *= 0.2f;
        }
        rigidbody2D.AddForce (new Vector2 (move * maxSpeed * forceMultiplier, 0));
    }

This allows for reduced air control, rapid acceleration, and force-based movement.

make 2 colliders for player, one circle2d as"wheel" and other box2d for body. Or make physics materiall 2d for colliders with 0 friction.

That’s exactly what I did. The player is two colliders, as in the tutorial. I linked the 2d controller tutorial so you’d know what I was working with.

The circle collider gets caught on the edge of a rectangle collider, and sticks. Then I can’t move. It winds up a few pixels below the platform surface, so can’t move toward the platform; it’s just pressing against the side.

I haven’t made the platforms or player zero friction because then they’d slide forever.

EDIT: It looks like making a bigger circle fixed it.

How big is your collider now?

I have similar issues but haven’t found a solution yet. Tried different setups, different scales but no luck. Even opened a bug that was resolved ‘by design’.