Tween
Controls playback of a property interpolation.
Behavior
Tween is returned by TweenService:Create.
Creation does not start playback. Call Play to begin.
Other scripts and physics can change the same properties during playback. Anchor parts before tweening their transforms.
Summary
The current playback state, such as playing, paused, completed, or cancelled.
Fires when playback reaches its final endpoint and passes Enum.PlaybackState.Completed.
Properties
PlaybackState
Tween.PlaybackState: EnumItemThe current playback state, such as playing, paused, completed, or cancelled.
Methods
Cancel
Tween:Cancel(): ()Stops playback, sets PlaybackState to Cancelled, and removes the active tween. Animated properties retain their current values. Completed does not fire.
Pause
Tween:Pause(): ()Pauses playback while retaining progress. Call Play to resume.
Play
Tween:Play(): ()Starts playback or resumes a paused tween. Has no effect if the tween is already playing.
Events
Completed
Tween.Completed: RBXScriptSignalFires when playback reaches its final endpoint and passes Enum.PlaybackState.Completed. Cancel does not fire this event. Indefinitely repeating tweens do not complete.
Operators
__type
Example
-- Requires an anchored Part named Door.
local TweenService = game:GetService("TweenService")
local door = workspace:WaitForChild("Door")
local tween = TweenService:Create(door, TweenInfo.new(1), { Transparency = 1 })
tween:Play()
tween:Pause()
tween:Cancel()