How to keep an object on a moving platform and not fall through if platform is move

I need help with moving an object that is currently on top of a moving platform. The object on the moving platform is not moving with the platform, instead it falls through as the platform is moved from side to side. They collide with each other and the object can sit on the moving platform if the platform was in one place but it when the platform moves, the object stays in one place and eventually falls. please help. thanks

You’ll have to code it.

if player is on platform → move player with platform

You could use a trigger zone, then OnTriggerEnter to detect the player, then as long as the player is in the trigger, move his transform along with the platform’s.