TweenService

TweenService : Instance

Properties

Methods

Create

The Create method is used to generate a new Tween animation for a specified Instance. Developers can customize the animation duration, easing style, easing direction, and affected properties through arguments provided to this method.

Parameters

Instance Instance

The object whose properties are to be animated

TweenInfo TweenInfo

Defines the configuration of the Tween, such as duration, easing style, and direction

Value PropertyTable

A table specifying the target properties and their desired values

Return

Instance

Code Samples

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

-- Setting Tween information
local TweenInfoData = TweenInfo.new(
    5,                         -- Time               
    Enum.EasingStyle.Linear,   -- EasingStyle
    Enum.EasingDirection.Out,  -- EasingDirection
    0,                         -- RepeatCount     
    false,                     -- Reverses
    0                          -- DelayTime
)

-- Properties to be changed with the tween
local TweenGoals = 
{
    Position = Vector3.new(-400, 50, -350)
}

local Tween = TweenService:Create(Part, TweenInfoData, TweenGoals)
Tween:Play()

Events

Last updated