Make a character not be affected by floor movement

Hi, I’m having a bit of a problem with an Endless Runner 2D game I have just started developing. I did a bit of research online and found out that the optimal way to create an endless runner is to make the players x position fixed, and create the illusion of movement by scrolling the background and the floor.

I am trying to do that, and I have achieved to endlessly move my background and floor and reposition while not in camera. However, my character is going to be running on the floor. Whenever he collides with the floor, the ground’s rigidbody is making my character move at the same speed the floor is moving, with no way to fix it and eventually moving offscreen to the left.

So my problem is that I need my player to collide with the ground, but no ground forces should be applied to my character so he can stay “running in place”. And I can’t freeze my character’s x position because I will try to implement a dash later, for which I need x-axis movement.

This is my first question so apologies if I have done something wrong. Thank you and stay safe, everyone!

Hi,
an easy workaround for this problem might be to just set the friction in the physics material of the ground to zero.
But it might be better to just freeze the x-position and instead move your camera and the world accordingly. A dash move could also be implemented by moving just your camera and the world.