how to make my character doesn't pass through a platform in vertical motion ?

Hi everyone, I have a character walking on a platform, everything is ok but when I put the platform in motion, my character goes through.

can someone help me please ?

thank you

This has been asked and answered before:

CharacterController falls through or slips off moving platforms

The best way to do this would probably make a script that makes the player a child of the platform when its inside a trigger which is placed just above the platform. Heres my example of it:

var parentToPlatform : Transform;
var parentToPlayer : Transform;
var characterTransform : Transform;
function Update () {
}
function OnTriggerEnter (other : Collider) {
        characterTransform.transform.parent = parentToPlatform;

}
function OnTriggerExit (other : Collider) {
    characterTransform.transform.parent = parentToPlayer;
}

just set the variables up and there you go