PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Value

KeyframeMarker

string

A value that is specified for a KeyframeMarker. Whenever the signal created from AnimationTrack/GetMarkerReachedSignal gets fired, this value will be passed into the connected function.

See also

  • Keyframe, holds the Pose|Poses applied to joints in a Model at a given point of time in an animation
  • AnimationTrack, controls the playback of an animation on a Humanoid or AnimationController


Code Samples


Add Marker/Remove Marker

This example demonstrates the Keyframe/AddMarker and Keyframe/RemoveMarker functions. Note these are functionally equivalent to Instance/Parent|parenting and un-parenting the markers.

local keyframe = Instance.new("Keyframe", workspace)
local marker = Instance.new("KeyframeMarker")
marker.Name = "FootStep"
marker.Value = 100

keyframe:AddMarker(marker) --marker.Parent = keyframe

wait(2)

keyframe:RemoveMarker(marker) --marker.Parent = nil

Get Keyframe Markers Attached to a Keyframe

This example demonstrates the Keyframe/AddMarker and Keyframe/GetMarkers functions. After adding two markers, marker1 and marker2 to the keyframe, this example gets and prints the names of the added markers.

local keyframe = Instance.new("Keyframe", workspace)

local marker1 = Instance.new("KeyframeMarker")
marker1.Name = "FootStep"
marker1.Value = 100

local marker2 = Instance.new("KeyframeMarker")
marker2.Name = "Wave"
marker3.Value = 100

keyframe:AddMarker(marker1) --marker.Parent = keyframe
keyframe:AddMarker(marker2) --marker.Parent = keyframe

local markers = keyframe:GetMarkets()
for _, marker in pairs (markers) do
	print(marker.Name)
end