Open Asterune
TweenService

TweenService

Interpolates instance properties over time.

Service
game:GetService("TweenService")
Inherits
Instance
Replication
Never

Behavior

TweenService creates Tween values that interpolate instance properties using TweenInfo timing. It is available on the server and clients. Run player-specific interface animations on the client.

Summary

Members4
Methods4

Methods

Create

TweenService:Create(instance: Instance, tweenInfo: TweenInfo, propertyTable: { [string]: any }): Tween

Creates a tween from an instance, a TweenInfo, and a table of target property values. Call Play on the result to start it.

Starting values are captured when playback begins. Supported interpolated values include numbers, Vector3, CFrame, Color3, and UDim2. Unsupported properties produce an error. Anchor parts before tweening their transforms to prevent physics from changing the same properties.

GetExecutionGroup

TweenService:GetExecutionGroup(): ExecutionGroup?

Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.

GetValue

TweenService:GetValue(alpha: number, easingStyle: EnumItem, easingDirection: EnumItem): number

Evaluates an easing curve at the supplied normalized progress.

SmoothDamp

TweenService:SmoothDamp(current: Vector3, target: Vector3, velocity: Vector3, smoothTime: number, maxSpeed: number?, deltaTime: number?): (Vector3, Vector3)

Moves a value toward a target using damped interpolation and returns the updated value and velocity.

Inherited members

Inherited47

Examples

Luau
-- 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()
Luau
-- Server Script. Requires an anchored Part named Door in workspace.
local TweenService = game:GetService("TweenService")
local door = workspace:WaitForChild("Door")
local info = TweenInfo.new(1.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local open = door.CFrame * CFrame.new(0, 0, 8)
local tween = TweenService:Create(door, info, { CFrame = open })
tween:Play()

TweenInfo · Tween · Enum.EasingStyle · Enum.EasingDirection