# Momentum of a ball on a moving platform

I'm seeking information on how to implement something. I have a ball on a moving platform. The ball has a position and momentum.

Here's a gif illustrating the situation:

So the way it works is, the ball detects when it touches a specific platform, and "childs" itself to that platform. When the platform moves, it will go through all its children and move them by the same amount.

My problem is, when the ball moves on a platform, it should accumulate momentum from the motion of the platform-- which should be visible when the platform slows down (or in some cases stops abruptly)

I've tried several things but always end up with an accelerating ball that zooms off in the direction of the platform. I've tried subtracting the component of the ball's momentum from the momentum that is going to be added but I still get an accelerating effect. In fact everything I try gives me acceleration in the direction of the platform's motion.

Can anyone explain to me what the right way is to deal with this problem?

• Edit to add some clarification:

In the interests of making this run on slower devices, the ball's physics are not complicated. The ball's main loop is a glorified version of mPosition+=mMomentum, with the player able to change the momentum.

When a ball is on a platform, all that happens is, the platform says "I moved n, therefore Ball->mPosition+=n" ... but I would be interested in hearing the "right" way to do this so that I can try to adapt it in such a way that it doesn't require a full hardcore physics simulation to run.

• does increasing the friction on the ball and platform work?
– Pow
Commented Feb 28 at 23:35
• In the interests of making this playable on slower machines, the physics is not complicated. The ball's friction is just a multiplier on its momentum. I'm looking for a way to simulate the effect, not run full physics on it. Commented Feb 29 at 11:18
• My mistake, I thought you were using Unity.
– Pow
Commented Feb 29 at 13:38
• How slow of a machine are you trying to run it on? Any computer or console made in the last 10 or 15 years should have more than enough processing power to run a physics engine for a simple scene like this. Even smartphones can handle physics as long as there aren't too many objects being simulated at once. Are you planning to have hundreds of balls moving around simultaneously? Commented Mar 2 at 2:24