TweenFloatingComponent

Entity round trips up and down.

# Properties

[{"index":"float Amplitude (Sync)","0":"Sets the distance between the lowest point to the highest point. The distance from the starting point to the lowest\/highest point is 0.5 if the value is 1."}]

[{"index":"float OneCycleTime (Sync)","0":"Sets the duration from the lowest point to the highest point in seconds.For example, duration of a rotation will be 2 seconds if the value is 1."}]

[{"index":"EaseType TweenType (Sync)","0":"Defines the moving method."}]

##### 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 an example of giving an Entity a floating effect.
    
    
    @Component
    script FloatingConfig extends Component
        @ExecSpace("ServerOnly")
        method void OnBeginPlay()
            local tween = self.Entity.TweenFloatingComponent
            
            -- Movement distance 0.1
            tween.Amplitude = 0.1
            -- Frequency 1 second
            tween.OneCycleTime = 1
            -- Effect of gradually slowing and then getting faster again
            tween.TweenType = EaseType.QuadEaseInOut
        end
    end
    

# SeeAlso

  * EaseType