Full example project, which shows how to implement flying platforms or other objects, like enemies.
...a script for flying objects, like platforms or enemies
...a script which prevents an object (or the player's character) on a moving platform to fall off.
Feel free to use them for your own projects.
If you have any questions, feel free to ask.