TweenLineComponent

Moves to the path designated by an entity. Supports various movement effects.

# Properties

[{"index":"CoordinateType DestinationCoordinateType (Sync)","0":"Sets whether Positions is the absolute or relative coordinates. Restarts the tween if changed during playback."}]

[{"index":"float Duration (Sync)","0":"Sets the duration from the departure point to the arrival point in seconds.For example, if Duration is 1 for OneRoundTrip, each one-way trip duration will be 1 second in the forward direction and 1 second in the reverse direction. So the total duration will be 2 seconds."}]

[{"index":"InterpolationType Interpolation (Sync)","0":"Sets the interpolation method for the movement path set in Positions. Restarts the tween if changed during playback."}]

[{"index":"SyncList Positions (Sync)","0":"Sets the movement path. Restarts the tween if changed during playback."}]

[{"index":"float ReturnDuration (Sync)","0":"Sets the duration returning from the destination to the starting point in seconds. Valid when UseReturnTweenType is true."}]

[{"index":"EaseType ReturnTweenType (Sync)","0":"Sets the movement effect returning from the destination to the starting point. Valid when UseReturnTweenType is true."}]

[{"index":"TweenLinearStopType StopType (Sync)","0":"Sets whether it moves one way or round trips."}]

[{"index":"EaseType TweenType (Sync)","0":"Sets the workout type."}]

[{"index":"boolean UseReturnTweenType (Sync)","0":"Sets whether to apply ReturnDuration and ReturnTweenType. Duration and TweenType will be applied upon returning from the destination to the starting point if the value is false."}]

##### inherited from TweenBaseComponent:

[{"index":"boolean AutoDestroy (Sync)","0":"When true, this Component is removed from an Entity when the tween reaches its destination and ends or when Stop() is called directly."}]

[{"index":"boolean AutoStart (Sync)","0":"If true, the tween will play automatically upon starting the game."}]

[{"index":"TweenState CurrentState (Sync) (ReadOnly) (HideFromInspector)","0":"The current playback state."}]

[{"index":"Vector3 OriginPosition (Sync) (ReadOnly) (HideFromInspector)","0":"The starting position of the tween."}]

[{"index":"Quaternion OriginRotation (Sync) (ReadOnly) (HideFromInspector)","0":"The initial rotation value of the tween."}]

[{"index":"Vector3 OriginScale (Sync) (ReadOnly) (HideFromInspector)","0":"The initial size of the tween."}]

[{"index":"TweenSyncType SyncType (ReadOnly)","0":"Sets the playback subject. The default value is Default. You can control the tween with functions on both the server and the client. Server status is always synchronized to the client. Setting the execution area control to client only restricts the control of the tween to the client only and does not synchronize to the server.Tween Control Functions: Play, Pause, Stop, Destroy, RestartFromCurrentPosition"}]

[{"index":"number TweenTime (ReadOnly) (HideFromInspector)","0":"The amount of elapsed time after starting the tween. The unit of measure is the second."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

##### inherited from TweenBaseComponent:

[{"index":"void Destroy()","0":"Changes CurrentState to Destroying and removes this Component."}]

[{"index":"void Pause()","0":"Pauses the tween. Changes CurrentState to Pausing."}]

[{"index":"void Play()","0":"Plays the tween. Changes CurrentState to Playing."}]

[{"index":"void RestartFromCurrentPosition()","0":"Restarts from current location."}]

[{"index":"void Stop(boolean reset)","0":"Stops the tween. Changes CurrentState to Idle. Specifying true for reset returns the tween's position and progress to the initial state."}]

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]

# Examples

This is example code which stops and executes Tween movement according to the key input.
    
    
    @Component
    script KeyboardTweenToggler extends Component
        @ExecSpace("ServerOnly")
        method void StopOrPlay()
        local tween = self.Entity.TweenLineComponent
    
        if tween.CurrentState == TweenState.Playing then
        	tween:Pause()
        else
        	tween:Play()
        end
        end
    
        @EventSender("Service", "InputService")
        handler HandleKeyDownEvent(KeyDownEvent event)
        -- Parameters
        local key = event.key
        --------------------------------------------------------
        if key == KeyboardKey.Q then
        	self:StopOrPlay()
        end
        end
    end
    

# SeeAlso

  * KeyDownEvent