2D platformer. Let player slide under object.

I am making a 2D platform.

There are 2 types of ground player can land on. One is normal on which a player can stand.
The other one is like a rope. Player can hold it and just slide.

What would be best way to implement rope type of ground.

I have two ideas in mind

Idea 1) Create a collider under the actual rope sprite and add sliding animation. Player stands on the lower collider.
Idea 2) Let rope have a collider. When player collides with rope, set gravity scale of player to 0. When collision exit, set gravity scale 1.

Any other method of producing result?

Also, currently I have added a collider under grounds which when triggers, it sets players collision to disable so player can pass through ground is he jumps up.
And another collider just above ground, that re enables player collider. This sort of works like one directional collider.

Is there any easier implementation for this one directional collider.?

EDIT :

Sliding :

49128-screen-shot-2015-06-29-at-23348-pm.png

I would definetely go with Idea 1.

If you disable gravity and let the player “bounce” against the rope, you get strange results when the slope increase/decrease. Beside, why mess around with the physics world if you don’t have to?

There is a third solution that fits well, if you have an explicit user-driven switch between rope sliding and normal walking (e.g. user needs to press a key): You actually have two collider on your player. One big normal collider that spans the whole body for movement and a second, very small circular collider where his hands are during the slide animation (in the upper-right corner of the normal character sprite area).

The rope itself has a collider that just spans the rope (it may go a bit below the rope, but not necessarily too much).

When you change to the slide state, disable the big and enable the small collider. If your character is positioned correctly, he will naturally “attach” to the rope since his hands are now on the other side of the rope. And he will naturally slide down the rope.

Be sure to assign correct layers to the rope collider to not have it collide with the main body collider or else the player may snap out of place when you switch back (and is generally unable to walk through a rope).