How to make a good door?

So my first approach to a door is to have a Script that would tween the door open when a click detector was pressed. But tweening on the server is like bad or something so I made a RemoteEvent triggered by a Script that would listen for a click detector, and every client would have a client script listening to the RemoteEvent and will tween the door when OnClientEvent fires.

But, if a client joins while the door is supposed to be open, they will not have gotten the memo, but there is no way to play a tween in the middle.

So is that a problem worth fixing or can I call it a day?

2 Likes

That’s a lot of hassle for a door. Your best option is tweening on the server via click detector.

If you really really dont want to use tween, you can rotate the door along a “hinge” / axis block (CFrame) or unanchor the door and use hinge / servo constraints. Not recommended though.

Tweening on the server is not recommended for performance. It has to replicate the changes every frame resulting in a choppy animation.

You could have the door be tweened locally, but then the door snaps to the open position server-side after a certain amount of time has passed, and same for closing. (This could also let you have it only send the signal to nearby players, since far away players don’t need to see the tweening animation)

You could put a bool value inside of the door, and make the server update that bool value. The clients can then listen to the bool value changing, and tween the door accordingly. Players joining will be able to see the state of the door, and open doors that should be opened

It’s a single door. Don’t over think it. Your not gonna drop down to negative a million fps from a 1 second tween.

1 Like