Reference API Roblox

Engine API

Website

Related

Reference API Roblox

TweenService

Used to create Tweens which interpolate, or tween, the properties of instances.

This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is a service. It is a singleton that may be acquired with GetService.
Tags: [NotCreatable, Service]

Member index 3

HistoryMember
498Create(instance: Instance, tweenInfo: TweenInfo, propertyTable: Dictionary): Tween
462GetValue(alpha: float, easingStyle: EasingStyle, easingDirection: EasingDirection): float
636SmoothDamp(current: Variant, target: Variant, velocity: Variant, smoothTime: float, maxSpeed: float?, dt: float?): (Variant, Variant)
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

TweenService is used to create Tweens which interpolate, or tween, the properties of instances. Tweens can be used on any object with compatible property types, including:

TweenService:Create(), the primary constructor function, takes TweenInfo specifications about the tween and generates the Tween object which can then be used to play the tween.

Note that Tweens can interpolate multiple properties at the same time, but they must not be interpolating the same property. If two tweens attempt to modify the same property, the initial tween will be cancelled and overwritten by the most recent tween.

History 7

Members 3

Create

Parameters (3)
instanceInstance
tweenInfoTweenInfo
propertyTableDictionary
Returns (1)
Tween

The Create() constructor creates a new Tween from three arguments: the object to tween, the TweenInfo specifications, and a table containing the properties to tween and values to tween to.

The propertyTable parameter needs to be a dictionary where the keys are the string names of the property (for example Position, Transparency, or Color), and the values are the property targets at the end of the tween.

The Tween created using this function is unique to the object given as the instance parameter. To apply the same tween to another object, call this function again with the new object.

History 3

GetValue

Parameters (3)
alphafloat
easingStyleEasingStyle
easingDirectionEasingDirection
Returns (1)
float

Returns a new alpha value for interpolating using the given alpha value, EasingStyle, and EasingDirection. The provided alpha value will be clamped between 0 and 1.

History 2

SmoothDamp

Parameters (6)
currentVariant
targetVariant
velocityVariant
smoothTimefloat
maxSpeedfloat?
dtfloat?
Returns (2)
Variant
Variant

History 1

Settings