📘 TweenService Notes (Roblox Studio)

🔹 What is TweenService?


🔹 Getting TweenService

local TweenService = game:GetService("TweenService")


🔹 TweenInfo

Defines how the tween behaves.

local TweenInfo = TweenInfo.new(
    Time,           -- Duration (in seconds)
    EasingStyle,    -- How the tween progresses (Linear, Quad, Bounce, Elastic, etc.)
    EasingDirection,-- In, Out, InOut
    RepeatCount,    -- Times to repeat (-1 = infinite)
    Reverses,       -- true/false (reverse after finishing?)
    DelayTime       -- Delay before starting
)

Example:

local info = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)


🔹 Creating and Playing a Tween

local part = workspace.Part

local goal = {
    Position = Vector3.new(0, 10, 0), -- target position
    Color = Color3.fromRGB(255, 0, 0) -- target color
}

local tween = TweenService:Create(part, info, goal)
tween:Play()


🔹 Tween Events

tween.Completed:Connect(function(status)
    print("Tween finished with status:", status) -- "Completed" or "Canceled"
end)