It’s generally known that you should tween stuff on the client; not the server (simply because visual effects like these should be handled by the client and will look smoother)
I have a problem where I cannot work out what to do if I have an object that should constantly be tweening, how would I tell clients who join the game to tween this object in an organised way?
For example, imagine I’m making an obby. Theres a part that I want to act as a moving platform, constantly tweening it’s position from one area to another. If I was making this platform during the server running with players inside, I can just use a remote event to tell the players in the game that I want this part to be tweened constantly. But how do I make it so clients who join after this remote event is fired also have this part tweened? They would not get the request to have this part tweened, and it would remain still.
Furthermore, if I had a bunch of parts that I wanted to be tweened constantly in different ways on the server before any players have joined yet (when the server starts up), how do I easily tell all the clients to tween these objects when they join?
I know that I would be able to just list every part inside a table or something, but it seems like it would be a nightmare to have many objects to be tweened and having to remember to update a table that I send to players. I kind of have this same problem when wanting to create and render particles on the client but not knowing how to do so if the player is joining after the particles are made.
One idea I had is to make a module store a table of all objects being tweened, and then sending this table to every player joining to tween all the objects at once, though I don’t know if this is the best method.
I hope I’ve explained this well enough!
(Also a side question about replicating tweens from the server to the client: If I wanted to tween a part and I used a remote event to tween this part on the client AND I tweened the part on the server (so they are in sync) will the client see the choppy server tween or the smooth tween on their own client?)
Thank you!