Player slowed down/sped up by moving platform

I have a moving platform that takes the player and sets it as a child to the moving platform. This works well to make the player move along with the platform. However, there is one issue. When the player is walking in the opposite direction that the platform is moving, it slows down because it is being pushed back, and when the player walks in the same direction of the moving platform, it speeds up because it is being pushed foward by the platform. How do I have the player speed remain constant while walking on the moving platform?

note: I am using transform.position to move my character and the platform.

Just to be quite clear, you are talking about walking on the platform? You need to remember that transform.position is setting position in world space. If you want to set position relative to the platform for which the player is a child, you need to use transform.localPosition.