Moving a platform out from underneath a player

If a player is on a moving paltform and idle, then the player moves along with the platform. Any ideas on how to make the player stay in place and not move/be affected by the movement of the platform? I’m trying to recreate something along the lines of the classic Mario growing/shrinking platforms where they slide out from underneath the player and the player then falls.