Hello
I’m having a problem with my moving platforms in 2D Game.
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?
P.S.
I tried to make a Friction Material with Friction of 10 and give my player friction of 5 at the same time.
you don’t have to move your player with the platform.just make the player child of the platform .so when the platform moves the player will go with it .
//platform script
void OnCollisionEnter2D(Collision2D other){
if (other.gameObject.CompareTag( "player")) {
other.gameObject.transform.parent = transform;
}
}
void OnCollisionExit2D(Collision2D other){
if (other.gameObject.CompareTag( "player")) {
other.gameObject.transform.parent = null;
}
}
so if an object with player tag collides with this platform,it will be child of this .