Make a platform that doesn't carry the player

I need my platformer character to not be carried by my platform. I still want the platform to interact with the player but if the player is on top of it when it moves the player will remain it the same position. A platform that slides under the player.

Took me a bit, but I think I did something that may help you.

I am using a tween behavior on both, the platform and the character.

The platform goes side to side, using a variable named “Dir”. It starts with a 1 value. Using a couple of limits, one in each xtreme of the path, and multipliying the varaible by -1 to make it go back.

When the character collides with the platform, I add a tween to it (Moving it very little, 1 pixel on the opposite direction of the platform, and for a long amount of time (10 seconds, more than enough for the platform to move away from the character))

Of course, this only works when you don’t press Left or Right, if you do, then the tween behavior is deleted.

If the character falls from the platform, I add a little pause before deleting the tween so the character don’t “floats”, touching the very edge of the platform.

I hope it helps you.