Why tweens are smoother on the client side?

Hi,
The title says all. After I put my script with some tweens in client side I noticed that they are cleary smoother, I thought if I learn what causes it I would avoid similar problems in the future. I have some suspicion but I’d rather know it from someone more experienced.

I think its because of replication, as it does it for everyone in the server but is just not visible and everything in the client, is for the client, meaning that there is no replication, so its only a one sided thing.

(This is my guess but I am not sure, it might be wrong)

1 Like

That’s because the Server needs to Replicate everything that happens on the Server.
Tweening on the Server means that it will update alot of times and in different Tween Styles, Which will not Replicate Correctly.

That’s why Animating should be done via Client, As the Client doesn’t needs to Replicate the Animations to anybody else.

1 Like

I have been trying this, but the only problem is that I need the animations to play for each player, and if the animations are done client side, the other players wont see the part move. How do I make a local tween play for each player?

I have tried this convoluted mess of a script firing a client script that fires all clients:
client side:

repeat wait() until game.Players.LocalPlayer
local tween=game:GetService("TweenService")
local part=game.Workspace.Part
local info=TweenInfo.new(5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,5,false,0)
local goal={Position=Vector3.new(5,5,5)}
local move=tween:Create(part,info,goal)

game.ReplicatedStorage.Event.OnClientEvent:Connect(function(part,goal)
	local move=tween:Create(part,info,goal)
	move:Play()
end)
if game.Players.LocalPlayer.Name=="Player1" then --makes sure player two does not do this aswell
	wait(2)
	move:Play()
	game.ReplicatedStorage.Event:FireServer(part,goal)
end

server side:

local event=game.ReplicatedStorage:WaitForChild("Event")

event.OnServerEvent:Connect(function(player,part,goal)
	for _,Player in pairs(game.Players:GetChildren()) do
		if Player ~= player then --makes sure it does not fire to the client that called the server.
			event:FireClient(Player,part,goal)
		end
	end
end)

Is this really the simplest way to do this? Is there a better way?

I have more information here

1 Like