Just an other collision problem

Hey, I know there are tons of threads like this, but i cant figure out the right solution.
The problem is the typical animation of a platform going up and down. Then, if I go on it and dont move, I fall through it.
Now I searched in differend threads for ideas, but I think I’m just bad at scripting. Now I just want to know if its impossible with my script to set sleep velocity to 0 for example or call the function “OnCollisionEnter(){” I dont expect you to fix it, only to say if there’s something completly wrong in my script and maybe which method would be best for this problem cuz I read many.

Sincerly ElGreco

Here’s the script:

Looks like you are using charactercontroller, this is what I’ve just added to mine to allow moving platforms, and it works brilliantly

Thx, thats the problem I have, but I find it quite difficult to understand what is said there. Did you use the 2D Platformer solution on top?