Roblox UtilitiesDevlHub Roblox Documentation

Class

TweenBase

NotCreatableNotBrowsable
Inherits
Instance › Object
Memory category
Instances
Subclasses
1

Abstract base class for in-between interpolation handlers. Tween inherits from TweenBase.

Abstract base class for in-between interpolation handlers; parent class of Tween.

Properties 1#

PlaybackStatePlaybackStateRead-only property that shows the current state for the Tween animation.ReadSafeReadOnlyNotReplicated

PlaybackState: PlaybackState#

ReadOnlyNotReplicatedReadSafe

Read-only property that shows the current stage for the Tween animation. See PlaybackState for descriptions of each state. Change using functions like Tween:Play().

Methods 3#

CancelHalts playback and resets the tween variables. If you then call TweenBase:Play(), the properties of the tween resume interpolating towards their destination, but take the full length of the animation to do so.
PauseHalts playback of the tween. Doesn't reset its progress variables, meaning that if you call TweenBase:Play(), the tween resumes playback from the moment it was paused.
PlayStarts playback of a tween. Note that if playback has already started, calling Play() has no effect unless the tween has finished or is stopped (either by TweenBase:Cancel() or TweenBase:Pause()).

Cancel(): ()#

Halts playback of a Tween and resets the tween variables.

Only resets the tween variables, not the properties being changed by the tween. If you cancel a tween halfway through its animation, the properties do not reset to their original values. Differs from TweenBase:Pause() in that once resumed, it takes the full duration of the tween to complete the animation.

Returns
  • ()

Pause(): ()#

Halts playback of the tween. Doesn't reset its progress variables, meaning that if you call TweenBase:Play(), the tween resumes playback from the moment it was paused.

If you want to reset the progress variables of the tween, use TweenBase:Cancel().

You can only pause tweens that are in the PlaybackState of Enum. PlaybackState.Playing; tweens in other states won't pause. If a tween is in a different PlaybackState such as Enum. PlaybackState.Delayed (as a result of its TweenInfo.DelayTime being greater than 0), attempting to pause the tween will fail and the tween will play following its specified delay time.

Returns
  • ()

Play(): ()#

Starts playback of a tween. Note that if playback has already started, calling Play() has no effect unless the tween has finished or is stopped (either by TweenBase:Cancel() or TweenBase:Pause()).

Multiple tweens can be played on the same object at the same time, but they must not animate the same property. If two tweens attempt to modify the same property, the initial tween is cancelled and overwritten by the most recent tween (see examples).

Returns
  • ()

Events 1#

CompletedFires when the tween finishes playing or when stopped with TweenBase:Cancel().

Completed(playbackState: PlaybackState)#

Fires when the tween finishes playing or when stopped with TweenBase:Cancel().

Passes the PlaybackState of the tween to any connected functions to give an indication of why the tween ended. Note that calling TweenBase:Pause() does not fire the Completed event.

NameTypeDefaultDescription
playbackStatePlaybackStateThe PlaybackState of the tween upon completion.

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed

Subclasses 1#