# Player moves too fast on moving platform

Hello,

I know there a lot of posts regarding this special issue with moving platforms. I spent at least 2 days trying out suggested solutions, but non of them worked out correctly. It seems I can not adapt the ideas to my case, so if anyone can explain me more in detail what is going wrong, I would really appreciate it!

Now to the point: I have a moving platform which move from one transform to another. Its velocity I calculate like this:

public void Update()
{...
Velocity = (_currentPoint.Current.position - transform.position).normalized * Speed * Time.deltaTime;
...}

In my Player class, I translate the players transform to the velocity of the platform, if he is standing on it:

public void Update()
{...
if (activePlatform != null)
{
var trans = activePlatform.GetComponentInParent<FollowPath>().Velocity;
transform.Translate(trans, Space.World);
}
...}

Now the player moves nicely with the platform, when he is standing on it. So far so good.

The problem begins, when I move my player. I move my player by setting the velocity of its RigidBody2D:

void FixedUpdate()
{
float move = Input.GetAxis("Horizontal");
GetComponent<Rigidbody2D>().velocity = new Vector2(move * _maxSpeed, GetComponent<Rigidbody2D>().velocity.y);
}

The player now moves on the platform, but too fast. I have the feeling even more when the players and the platforms direction is the same.

Can somebody explain me why? The players Rigidbody Velocity is the same as if he is standing on normal ground. So, in combination with the Translate in the Update(), the players absolute Speed should be the speed of the platform + its rigidbody speed, but it is much more.

I also would like how to measure exactly the speed of my player - in relation to the platform, and in relation to the normal world. Is there a easy way to do that?

EDIT: Fun Fact: When the platform moves only vertically, the Player is still faster than on the Ground. So my assuption that somehow the player got “too much” speed (in the X direction) from the platform movement, was wrong. That actually leaves me even more lost …

UPDATE: The best results I can get is making the moving platform the parent of the players game object, although this is widely and often NOT recommended, but it worked the best for me. I deleted transform.Translate in the Update() and in the FixedUpdate(), if my player is standing on the platform, I generally subtract 1 from my _maxSpeed, and additionally 1 if the player is moving in the same direction as the platform:

float move = Input.GetAxis("Horizontal");

var modSpeed = _maxSpeed;

if (activePlatform != null)
{
var xP = (float) activePlatform.GetComponentInParent<FollowPath>().SpeedX;

if ((GetComponent<Rigidbody2D>().velocity.x > 0 && xP > 0) || (GetComponent<Rigidbody2D>().velocity.x < 0 && xP < 0))
{
modSpeed -= 1;
}
modSpeed -= 1;
}

GetComponent<Rigidbody2D>().velocity = new Vector2(move * modSpeed, GetComponent<Rigidbody2D>().velocity.y);

The result is great - although I would really like to know why I have to do those speed modifications.