TweenInfo

Constructors

NameDescription
new(time: number,easingStyle: Enum.EasingStyle,easingDirection: Enum.EasingDirection,repeatCount: number,reverses: boolean,delayTime: number)Returns a new TweenInfo, used to configure how a Tween animates via TweenService:Create(). All parameters are optional: time defaults to 1, easingStyle defaults to Enum.EasingStyle.Quad, easingDirection defaults to Enum.EasingDirection.Out, repeatCount defaults to 0 (a value of -1 repeats indefinitely), reverses defaults to false, and delayTime defaults to 0.

Code Snippet

local TweenService = game:GetService("TweenService")
local Part = workspace.Part

local tweenInfo = TweenInfo.new(
    2,
    Enum.EasingStyle.Sine,
    Enum.EasingDirection.InOut,
    -1,
    true,
    0.5
)

local tween = TweenService:Create(Part, tweenInfo, { Position = Part.Position + Vector3.new(0, 10, 0) })
tween:Play()

Properties

NameTypeDescription
TimenumberDuration of the tween, in seconds. Read-only.
EasingStyleEnum.EasingStyleThe style in which the tween executes - the curve used for interpolation. Read-only.
EasingDirectionEnum.EasingDirectionThe direction in which the tween executes. Read-only.
RepeatCountnumberNumber of times the tween repeats after its first play. -1 indicates the tween repeats indefinitely. Read-only.
ReversesbooleanWhether the tween interpolates back to its start value after reaching its goal, before repeating. Read-only.
DelayTimenumberTime of delay, in seconds, until the tween begins. Read-only.