Tweens slower in game than in studio?

Hello all! I’m attempting to make a tiny prototype for a game I might finish later, but I’ve so far only tested in studio. I just attempted testing using actual roblox but I noticed instantly that my animations take about half a second to play.

Studio: https://gyazo.com/c6b20cb9a7c114f496c9a81e43b5674d
Roblox: https://gyazo.com/89f3eb32b387af7c0d91319f360fe842

In the roblox one I’m constantly clicking.

This is the code for the tween:

coroutine.wrap(function()
		wait(0.05)
		local Tween = TweenService:Create(CFXClone.Text, TI,
			{Position = PlayerGUI.MainUI.Background.Currency.Position + UDim2.new(PlayerGUI.MainUI.Background.Currency.Size.X.Scale/2, 0, 
				PlayerGUI.MainUI.Background.Currency.Size.Y.Scale/2, 0),

				TextTransparency = 1, Rotation = math.random(-180, 180),TextColor3 = Color3.fromRGB(255, 235, 121)}
		)
		Tween.Completed:Connect(function()
			wait(0.05)
			CFXClone:Destroy()
		end)
		Tween:Play()
	end)()

The rest is just the animations for sizing + desizing the text on the left for a tiny effect. Any advice?

Edit: It seems like it works better on my phone than this laptop Maybe my laptops less powerful than my phone? Anyways. I’m going to go try on my pc, see if it’s any better.

Studio does not have any replication lag. Is there any code on the server that sends data back and fourth?

1 Like

Just the remote that tells the server that I clicked and to add the proper amount of currency to my account, but I did completely forget about replication lag. I am going to go check everything and make sure everything’s fine. Thanks for the reply!

Edit: Yeah this is more than likely the issue on these lines:

local NewVal = OnClick:InvokeServer()

PlayerGUI.MainUI.Background.Currency.Text = NewVal -- This has formatting in game obviously

Edit 2:
Yes. Coroutining it fixed it. Thanks!