GetMarkerReachedSignal
For thread safety, this property is not safe to read in an unsynchronized thread.
This function returns an DataType/RBXScriptSignal|event similar to the AnimationTrack/KeyframeReached event, except it only fires when a specified KeyframeMarker has been hit in an Animation|animation. The difference allows for greater control of when the event will fire.
To learn more about using this function, see Animation Events in the articles/using animation editor|Using the Animation Editor article.
More About Keyframes
Keyframe names can be set in the Roblox articles/using animation editor|Animation Editor when creating or editing an animation. They cannot, however, be set by a Script on an existing animation prior to playing it.
Keyframe names do not need to be unique. For example, if an Animation has three keyframes named “EmitParticles,” the connected event returned by this function will fire each time one of these keyframes is reached.
See Also
AnimationTrack, controls the playback of an animation on aHumanoidorAnimationControllerKeyframe, holds thePose|Posesapplied to joints in aModelat a given point of time in an animationKeyframe/AddMarkerKeyframe/RemoveMarkerKeyframe/GetMarkers
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
|
|
The name of the |
Returns
| Return Type | Summary |
|---|---|
|
The signal created and fired when the animation reaches the created |
Code Samples
Listening to Keyframe Markers
This LocalScript code waits for the local player’s Humanoid object to load, then it creates a new Animation instance with the proper Animation/AnimationId|AnimationId. The animation is then loaded onto the humanoid, creating an AnimationTrack, and the track is played with AnimationTrack/Play|AnimationTrack:Play(). Following that, the AnimationTrack/GetMarkerReachedSignal|GetMarkerReachedSignal() function detects when the “KickEnd” marker is hit.