Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Is this a proper way to wait a client tween?

Asked by
Dfzoz 489 Moderation Voter
5 years ago
Edited 5 years ago

I made a tween to animate a bomb expanding. After the tween(that lasts 1 second), the bomb explodes.

Part of the Server Script Code:

1local player = game. players.SOMEPLAYER
2local bomb = script.Parent
3game.ReplicatedStorage.TweenBomb:FireAllClients(bomb)
4wait(1)

Local Script Code(For a smoother animation):

1local tweenservice = game:GetService("TweenService")
2function tweenBomb(bomb)
3local tweeninfo = TweenInfo.new(1,Enum.EasingType.Linear)
4local goal = {}
5goal.Size = bomb.Size*2
6local newTween = TweenService:Create(bomb,tweeninfo,goal)
7newTween:Play()
8end
9game.ReplicatedStorage.TweenBomb.OnServerInvoke:Connect(tweenBomb)

What I would like to know is if there is some problem that could happen with this method, like a notable lack of sincrony or the bomb taking longer to explode. If there is way that could fix such issue, I would like to know too.

1 answer

Log in to vote
2
Answered by
bluzorro 417 Moderation Voter
5 years ago

Because you made it on the client, it's good, but if it's on the client, there may be lag included in the tween because nobody has a perfect connection. And to be able to fix the lag, here is a link:

Improving game performance

Ad

Answer this question