Create Tween

Playable
Both Server and Client
Both Mobile and PC

Create interpolated motion, the specified attributes of the target entity will move smoothly according to the settings

Declaration

func CreateTween(target entity<Entity>, property Property, srcVal object, destVal object, style TweenStyle, curve BezierCurve, duration float, out var createdEntity entity<Tween>, autoPlay bool)
go

Parameters

Input

Name Type Description
Target Entity Target Entity
Property Property The attribute ID that needs movement change
Source Value Object Attribute starting value
Destination Value Object Attribute end value
Style TweenStyle You can choose single, loop and reciprocating.
Loop means that after each movement is completed, the entity will move again from the starting value. Reciprocating means that after the movement from the starting value to the target value is completed, t
Curve BezierCurve Bezier curve control points
Duration (ms) Float The duration of a change, in milliseconds
Auto Play Bool Whether to automatically start playing after creation

Out

Name Type Description
Created Entity Tween Created interpolated motion entity