Lernen
Engine-Klasse
TweenService
Nicht erstellbar
Dienst

*Dieser Inhalt wurde mit KI (Beta) übersetzt und kann Fehler enthalten. Um diese Seite auf Englisch zu sehen, klicke hier.


Zusammenfassung
Methoden
Create(instance: Instance,tweenInfo: TweenInfo,propertyTable: Dictionary):Tween
GetValue(alpha: number,easingStyle: Enum.EasingStyle,easingDirection: Enum.EasingDirection):number
SmoothDamp(current: Variant,target: Variant,velocity: Variant,smoothTime: number,maxSpeed: number?,dt: number?):Tuple
Geerbte Mitglieder
Code-Beispiele
Tween-Erstellung
local TweenService = game:GetService("TweenService")
local part = Instance.new("Part")
part.Position = Vector3.new(0, 10, 0)
part.Color = Color3.new(1, 0, 0)
part.Anchored = true
part.Parent = game.Workspace
local goal = {}
goal.Position = Vector3.new(10, 10, 0)
goal.Color = Color3.new(0, 1, 0)
local tweenInfo = TweenInfo.new(5)
local tween = TweenService:Create(part, tweenInfo, goal)
tween:Play()
Eine Tween Schleife
local TweenService = game:GetService("TweenService")
local part = Instance.new("Part")
part.Position = Vector3.new(0, 10, 0)
part.Anchored = true
part.Parent = workspace
local tweenInfo = TweenInfo.new(
2, -- Zeit
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
-1, -- RepeatCount (wenn weniger als null, wird der Tween unendlich wiederholt)
true, -- Reverses (Tween wird rückwärts abgespielt, nachdem er sein Ziel erreicht hat)
0 -- DelayTime
)
local tween = TweenService:Create(part, tweenInfo, { Position = Vector3.new(0, 30, 0) })
tween:Play()
task.wait(10)
tween:Cancel() -- beende die Animation nach 10 Sekunden
Pause eines Tweens
local TweenService = game:GetService("TweenService")
local part = Instance.new("Part")
part.Position = Vector3.new(0, 10, 0)
part.Anchored = true
part.BrickColor = BrickColor.new("Helles grün")
part.Parent = workspace
local goal = {}
goal.Position = Vector3.new(50, 10, 0)
local tweenInfo = TweenInfo.new(10, Enum.EasingStyle.Linear)
local tween = TweenService:Create(part, tweenInfo, goal)
tween:Play()
task.wait(3)
part.BrickColor = BrickColor.new("Helles rot")
tween:Pause()
task.wait(2)
part.BrickColor = BrickColor.new("Helles grün")
tween:Play()

API-Referenz
Methoden
Create
Funktionen: Basic
TweenService:Create(
instance:Instance, tweenInfo:TweenInfo, propertyTable:Dictionary
Parameter
instance:Instance
tweenInfo:TweenInfo
propertyTable:Dictionary
Rückgaben
Code-Beispiele
Tween-Erstellung
local TweenService = game:GetService("TweenService")
local part = Instance.new("Part")
part.Position = Vector3.new(0, 10, 0)
part.Color = Color3.new(1, 0, 0)
part.Anchored = true
part.Parent = game.Workspace
local goal = {}
goal.Position = Vector3.new(10, 10, 0)
goal.Color = Color3.new(0, 1, 0)
local tweenInfo = TweenInfo.new(5)
local tween = TweenService:Create(part, tweenInfo, goal)
tween:Play()
Eine Tween Schleife
local TweenService = game:GetService("TweenService")
local part = Instance.new("Part")
part.Position = Vector3.new(0, 10, 0)
part.Anchored = true
part.Parent = workspace
local tweenInfo = TweenInfo.new(
2, -- Zeit
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
-1, -- RepeatCount (wenn weniger als null, wird der Tween unendlich wiederholt)
true, -- Reverses (Tween wird rückwärts abgespielt, nachdem er sein Ziel erreicht hat)
0 -- DelayTime
)
local tween = TweenService:Create(part, tweenInfo, { Position = Vector3.new(0, 30, 0) })
tween:Play()
task.wait(10)
tween:Cancel() -- beende die Animation nach 10 Sekunden

GetValue
Funktionen: Basic
TweenService:GetValue(
alpha:number, easingStyle:Enum.EasingStyle, easingDirection:Enum.EasingDirection
Parameter
alpha:number
easingStyle:Enum.EasingStyle
easingDirection:Enum.EasingDirection
Rückgaben

SmoothDamp
Parallel schreiben
Funktionen: Basic
Simulationszugang
TweenService:SmoothDamp(
current:Variant, target:Variant, velocity:Variant, smoothTime:number, maxSpeed:number?, dt:number?
Parameter
current:Variant
target:Variant
velocity:Variant
smoothTime:number
maxSpeed:number?
dt:number?
Rückgaben

©2026 Roblox Corporation. Roblox, das Roblox-Logo und "Powering Imagination" gehören zu unseren eingetragenen und nicht eingetragenen Markenzeichen in den USA und anderen Ländern.