TweenService

TweenService : Instance

Overview

The TweenService is a service that provides functionality for creating and managing Tween animations in Roblox, enabling smooth transitions in game objects' properties.

Description

The TweenService simplifies the animation process by providing a structured way to interpolate values for properties such as position, rotation, color, size, and more. With its flexibility and powerful features, it is ideal for making dynamic animations that enhance gameplay and visual appeal.

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") -- ์ด๋™์‹œํ‚ฌ ํŒŒํŠธ

-- Tween ์ •๋ณด ์„ค์ •
local TweenInfoData = TweenInfo.new(
    5,                        -- ์ง€์† ์‹œ๊ฐ„ (์ดˆ)
    Enum.EasingStyle.Linear,  -- ํŠธ์œˆ ์Šคํƒ€์ผ
    Enum.EasingDirection.Out, -- ํŠธ์œˆ ๋ฐฉํ–ฅ
    0,                        -- ๋ฐ˜๋ณต ํšŸ์ˆ˜
    false,                    -- ์™•๋ณต ์—ฌ๋ถ€
    0                         -- ๋Œ€๊ธฐ ์‹œ๊ฐ„
)

-- ํŠธ์œˆ ์œ„์น˜ ์ด๋™
local TweenGoals = 
{
    Position = Vector3.new(-400, 50, -350)
}

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

Events

Last updated