I want player to stay on the moving platform without sliding and if i want to move i want player to move freely on platform even when platform moves.
So what i did is i add moving platform’s velocity to player’s body but player still sliding. I look up the problem on google and here but can’t find a solution. Some people add platform’s speed to player body’s setTransform method but it is just not working or i am doing something wrong.
I am adding executable jar file:
and source code:
playerUpdate method in Player class is where i add platform’s velocity to player.
To control player use arrow keys and press ‘x’ to show box2d debug renderer.
I hope i explain it good.
Thanks in advance.