function getMotionState(Scope: Scope): (goalState: State<any>, motionStateType: string, ...any) -> CanBeState<any>
Initializes the utility component and returns a new function to create a State
from that component, which is used to easily create a motion from it. This provides an easy way of calling certain animations within Fusion, such as Spring
.
Default Syntax
local getMotionStateUtility = require(StudioComponents.Util.getMotionState)
local getMotionState = getMotionStateUtility(Scope)
Shorthand
local getMotionState = require(StudioComponents.Util.getMotionState)(Scope)
Parameters
Scope: Scope |
The Scope the utility function will be initialized in. |
Returns Function
Parameters
goalState: State<any> |
The goal state to be reached. |
motionStateType: string |
The type of the motion function. Can either be "Tween" or "Spring". |
...any |
The other arguments to be passed to the motion function. |
Returns