Apprendre
Classe de moteur
Tween

*Ce contenu est traduit en utilisant l'IA (Beta) et peut contenir des erreurs. Pour consulter cette page en anglais, clique ici.


Résumé
Membres hérités
Échantillons de code
Création de Tween
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()

Référence API
Propriétés
Instance
Lecture uniquement
Non répliqué
Lecture parallèle
Capacités : Basic
Tween.Instance:Instance
Échantillons de code
Instance de Tween
local TweenService = game:GetService("TweenService")
local function isInstanceAPart(tween)
local instance = tween.Instance
return instance:IsA("BasePart")
end
local tweenInfo = TweenInfo.new()
local instance = Instance.new("Part")
local tween = TweenService:Create(instance, tweenInfo, {
Transparency = 1,
})
print(isInstanceAPart(tween))

TweenInfo
Lecture uniquement
Non répliqué
Lecture parallèle
Capacités : Basic
Tween.TweenInfo:TweenInfo
Échantillons de code
Exemples de TweenInfo
-- Un TweenInfo avec tous les paramètres par défaut
TweenInfo.new()
-- Un TweenInfo avec son temps réglé à 0,5 secondes.
TweenInfo.new(0.5)
-- Un TweenInfo avec son style d'assouplissement réglé sur Back.
TweenInfo.new(0.5, Enum.EasingStyle.Back)
-- Un TweenInfo avec sa direction d'assouplissement réglée sur In.
TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.In)
-- Un TweenInfo qui se répète 4 fois.
TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.In, 4)
-- Un TweenInfo qui inverse son interpolation après avoir atteint son objectif.
TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.In, 4, true)
-- Un TweenInfo qui boucle indéfiniment.
TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.In, -1, true)
-- Un TweenInfo avec un délai de 1 seconde entre chaque interpolation.
TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.In, 4, true, 1)

©2026 Société Roblox. Roblox, le logo Roblox et Powering Imagination font partie de nos marques déposées aux États-Unis et dans d'autres pays.