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

RemoveMarker

This function removes a KeyframeMarker from the Keyframeby settings its Instance/Parent|Parent to nil.

The KeyframeMarker’s Instance.Parent is set to nil but it is not destroyed. This means, provided the marker is referenced it can be re-parented later.

Note, this function will not error when an instance other than a KeyframeMarker is given as the parameter.

More about Keyframes

Keyframe names do not need to be unique. For example, if an Animation has three keyframes named “Particles” the connected event returned by AnimationTrack/GetMarkerReachedSignal will fire each time one of these keyframes is reached.

Keyframe names can be set in the Roblox Animation Editor when creating or editing an animation. They cannot however be set by a Script on an existing animation prior to playing it.

See also

  • Keyframe/AddMarker
  • Keyframe/GetMarkers
  • AnimationTrack/GetMarkerReachedSignal

Parameters

Name Type Default Description

The marker being removed from the Keyframe

Returns

Return Type Summary

No return


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