In my game, im planning to have it so that when players click a door, they teleport onto the other side.
It works by clicking on the door, then a RemoteEvent is fired to the client, which on the client side a transition animation occurs and also teleports the client which is also handled by the Client.
Server Side
local transitioning = {}
local Events = game.ReplicatedStorage.Events
Model.DoorIn.ClickDetector.MouseClick:Connect(function(Plr)
if not transitioning[Plr] then -- so that the player cannot request another transition whilst a transitioning is already happening.
Events.Transition:FireClient(Plr, Model.TeleportIn.CFrame)
transitioning[Plr] = true
print(Plr)
wait(0.6)
transitioning[Plr] = nil
end
end)
Client Side
Events.Transition.OnClientEvent:Connect(function(returnedData)
transitionIn() -- does the GUI transition animation
wait(0.5)
Plr.Character:SetPrimaryPartCFrame(returnedData)
transitionOut()
end)
Is there a better way to do this? More on the side of better performance and compensating for latency delay?

2 comments
are you having issues with latency or performance?
not necessarily, but in case if players do, and if there are any better practices to achieve this in general