Best practice animating a sliding door?

Hello I have multiple sliding doors in my game (around 10-20) which all have sliding animations. to open and close them. I was wondering what the best way is to animate these doors? Most of the doors have multiple parts. I can think of multiple ways to animate them, which I will list below. But which one is best for roblox physics/script lag/ server client replication? Or is there a way that i missed?

  • If possible, turn the door into a union to decrease the amount of moving parts
  • Use tweens for an union/single part door
  • Use tweens for every part of the door
  • Use a heartbeat loop to then change the CFrame of the primary part of the door every iteration
  • Use a prismaticconstraint with servo motor to move one part of the door and the other parts are welded to that part
2 Likes

The best method I can think of is weld all the parts to a main part then tween the main part. Make sure all the parts except the main part are unanchored, of course. You can use unions to reduce the number of objects that need to be welded, but I would try to avoid using unions as much as possible.

I am not certain if running the tweens on the client is better than running them on the server, but it’s an experiment worth conducting.

You should make it modular. So the main functionality is controlled in 1 script. Which is good for future edits without going thru each door and editing it. You should also use tween service and use a remote event to tween it to the Client which makes it smoother. If u have any questions then feel free to ask

Alright, so make it instantaneous on server and then fire a remoteevent to the client stating which door is being tweened? And how would tweening work for doors consisting of ~20 parts or so? Do I tween every part separately?