OpenTween is a tweening module for Roblox intended to improve visual quality and smoothness while keeping performance in mind. It allows for client-side, server-side, and synchronised tweens across all clients in a single package.
OpenTween handles everything it needs internally — remote events are created and managed automatically, so there's no manual setup required beyond placing the scripts. Tweens can also be paused or cancelled at any time regardless of where they're running.
OpenTween is a fork of AstraTween by AstraX2. AstraTween is an excellent client-sided tweening module and the foundation that OpenTween builds on. OpenTween extends it with server-side execution, client synchronisation, and pause/cancel support.
Place the ModuleScript in ReplicatedStorage and the LocalScript as a descendant of StarterPlayerScripts. The LocalScript's rootPath variable should point to wherever the ModuleScript is parented — it defaults to game.ReplicatedStorage.
Blocks being tweened via TweenInstance should have Anchored set to true to prevent physics from interfering.
The following options are available in the config table at the top of the ModuleScript.
| Option | Type | Default | Description |
|---|---|---|---|
serverIsReplicationPrimary |
bool |
true |
Clients report progress back to the server. Enables pause, cancel, and out-of-sync correction. |
explicitServerAnimation |
bool |
true |
Default functions (TweenModel, TweenInstance, TweenInstanceFull) also run the tween on the server's workspace in addition to firing to clients. |
syncMargin |
number |
5 |
Margin of error in seconds before a client is considered out of sync and corrected. |
syncCorrectionTime |
number |
0.5 |
Duration in seconds over which a correction tween is applied to an out-of-sync client. Snaps if the correction tween itself drifts. |
OpenTween exposes three namespaces. The default namespace respects explicitServerAnimation. OpenTween.Server always runs the tween on the server's workspace. OpenTween.Client never touches the server's workspace and only fires to clients.
All tween calls return a tweenId string that can be used with PauseTween, ResumeTween, and CancelTween.
Tweens a model using its PrimaryPart as a pivot. PrimaryPart must be set.
| Argument | Type |
|---|---|
model |
Model |
time |
number |
style |
Enum.EasingStyle or string |
direction |
Enum.EasingDirection or string |
goalPosition |
CFrame, Vector3, BasePart, or UnionOperation |
Tweens an instance. Functionally similar to TweenService:Create() with fewer arguments. Use TweenInstanceFull to access repeat, reverse, and delay options.
| Argument | Type |
|---|---|
target |
Instance |
time |
number |
style |
Enum.EasingStyle or string |
direction |
Enum.EasingDirection or string |
goalTable |
{Property = Value, ...} |
OpenTween:TweenInstanceFull(target, time, style, direction, repCount, reverses, delayTime, goalTable)
Tweens an instance with full TweenInfo control.
| Argument | Type |
|---|---|
target |
Instance |
time |
number |
style |
Enum.EasingStyle or string |
direction |
Enum.EasingDirection or string |
repCount |
number (set to -1 for infinite repeats) |
reverses |
boolean |
delayTime |
number |
goalTable |
{Property = Value, ...} |
Pauses an active tween on the server and all clients. Requires serverIsReplicationPrimary to be true.
Resumes a paused tween on the server and all clients.
Cancels an active tween on the server and all clients and removes it from tracking.