moving platform (train)

I know that there is a tutorial for moving platform and it works somehow for updown movement. my question is that how can I get an object move along with x/z movement. For example I have a Playerprefab that created at runtime in a transtation it able to walk around in the trainstation, but once it’s get into the train, the train will leave station and the player should still able to walk inside train while train is moving. I had this problem solved by add player as child of the train, but now program needs extent to mulitplayer game, no idea how can i add a gameobject as a child of something at runtime, esp for runtime prefabs.

I dont know if I undertood… try this Unity - Scripting API: Transform.parent

best regards,

reigota