...or I guess you could just remember where the platforms were when restarting the level. That would work too and would be a lot simpler!
Thanks for the feedback, I have some other things to fix/add, mainly the movement speed of the platform, they are slow as snail hahaha