2D Moving platforms is slippery!

Hello :slight_smile:

I’m having a problem with my moving platforms
It seems like it need to move every time when the platform is moving to stay on it.
But I want to make it like classic way, that if you are standing on moving platform you don’t need to move to stay on it
What can cause the problem?

I tried to make a Friction Material with Friction of 10 and give my player friction of 5 at the same time.

In my game I’ve added this line of code in my Player Controller Script and add the Tag “MovingPlatform” to the platforms that are moving.

// Check if the Player is on a Platform and set the Player as child of the Platform
	void OnCollisionEnter2D (Collision2D other) {
		if (other.gameObject.tag == "MovingPlatform") {
			transform.parent = other.transform;
		}
	}

	// Check if the Player leaves a Platform and set it back out of Parent
	void OnCollisionExit2D (Collision2D other) {
		if (other.gameObject.tag == "MovingPlatform") {
			transform.parent = null;
		}
	}

Try to do this:
run this in an update → If player is colliding with the platform then the position.x of the player should be = the position.x of the platform.

Depends a bit on how your collision detection works. In this tutorial

the dev has the same issue, and shows how to solve it (using raycasts).