Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do you detect a specific keyframe from a script in roblox studio?

humanim.KeyframeReached:Connect(function(keyframename)
	print(keyframename)
	if keyframename == "HandsOut" then
		local gras = script.Parent.Parent.Spawn_Grass
		local gra = gras:Clone()
		gra.Parent = workspace
		gra.Transparency = 0
		gra.Anchored = false
		gra.CanCollide = true
	end
end)

humanim is the animation, it plays but then the name checker doesn't work

2 answers

Place an animation event in your animation at the keyframe u want and use GetMarkerReachedSignal

Example:

humanim:GetMarkerReachedSignal("HandsOut"):Connect(function()
      local gras = script.Parent.Parent.Spawn_Grass
        local gra = gras:Clone()
        gra.Parent = workspace
        gra.Transparency = 0
        gra.Anchored = false
        gra.CanCollide = true
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.