Rigidbody (player) moves slower on moving platform

I’m trying to make my rigidbody player move on a platform and I cannot figure it out. There were a few questions already about it but none of the answers seemed to work for me.

If I put a rigidbody on the platform, make it kinematic and move it using MovePosition, the player bounces up and down when the platform moves up/down and falls off the platform when it moves right/left. If I take the rigidbody off the platform, move its transform and set the player to be a child of the platform, the player sticks to the platform as it should but left and right movement is slow and jittery.

I have a deadline that I need to meet very soon on this and I’m getting a bit worried, any ideas?

how it was solved for me. I am just implementing moving platforms in my game now and discovered the same issue. My problem was the rigidbody2d interpolation. while on the platform try changing the interpolation to none, then if you are using interpolation or extrapolation, just switch it back when you get off of the platform… rigidbody2D.interpolation = RigidbodyInterpolation2D.None.
Also the player has to be parented to the moving platform while on it.
Hope this helps.

This answer is a little over a year old, but I had a somewhat similar problem as this.

In my project, the player moves with animator root motion while the platform moves with an animation instead.

I made my platform’s script to let the platform become the parent of any object that is on it and set that object’s parent to null if it ever leaves the platform. Now, the problem arises when my player jumps onto the platform, he’s speed is suddenly slow.

In order to fix this, I had to go into the player’s script and create a boolean value that checks if he is on a moving platform or not, now if he is, use rigidbody.velocity movement with a greater speed, then if he isn’t, use the default animator root motion instead.

I hope this gives you an idea on how to fix this if you encounter the same problem.

PS: If you have jitters while on the platform, you should put your camera follow codes in LateUpdate(). If you use Cinemachine, set the X and Y damping to 0.

CHEERS!

If you are not moving your platform with physics( aka it doesn’t have a rigidbody) you can set the player as a child of the platform while it is on top of it and set the interpolation mode of the player rigidbody to ‘none’:

private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.CompareTag("Player"))
        {
            collision.transform.SetParent(transform);
            Rigidbody2D playerRb = collision.gameObject.GetComponent<Rigidbody2D>();

            playerRb.interpolation = RigidbodyInterpolation2D.None;
        }
    }

    private void OnCollisionExit2D(Collision2D collision)
    {
        if (collision.gameObject.CompareTag("Player"))
        {
            collision.transform.SetParent(null);
            Rigidbody2D playerRb = collision.gameObject.GetComponent<Rigidbody2D>();

            playerRb.interpolation = RigidbodyInterpolation2D.Interpolate;

        }
    }