Skip to content

API Function tween

github-actions[bot] edited this page Nov 24, 2026 · 1 revision

Function: tween()

function tween<T, K>(
   target, 
   field, 
   to, 
   options
): Tween;

Defined in: src/plugins/animation/runtime/api.ts:16

Animate one field of a Transform or component to to (ADR 0371, 0372): tween(this.node.transform, "position", [0, 2, 0], { duration: 0.4, ease: "outBack" }). The tween is a one-track clip evaluated in the animation core; it starts at the next animation update. Await it (or call .then) for its end: it resolves with finished, stopped, or destroyed when its target goes away.

Type Parameters

T

T extends TweenTarget

K

K extends string

Parameters

target

T

field

K

to

TweenValue

options

TweenOptions

Returns

Tween

Clone this wiki locally