A person named XAXA told me this, Name your keyframes in the animationeditor after exporting them and replace the default animations with the new ones you created
*And then, * (This was an example)
AnimationTrach:KeyFrameReached:connect(function(name) if name == "blah" then -- steps end end)
Ok, I tried doing this but I didn't have great luck with it, I don't hear the sound play.
the parent of this script is an animation. Please note that this animation replaces the default roblox animation of the player character
local player = game.Players.LocalPlayer
local character = game.Workspace:WaitForChild(player.Name)
local humanoid = character:WaitForChild("Humanoid")
local sound = script:WaitForChild("FootstepSound")
local AnimationTrack = humanoid:LoadAnimation(script.Parent)
AnimationTrack.KeyframeReached:Connect(function(name)
if name == "FootStep1" then
sound:Play()
end
end)
AnimationTrack.KeyframeReached:Connect(function(name)
if name == "FootStep2" then
sound:Play()
end
end)

1 comment
That fixed the output error before thank you, but for some reason the footstep sound doesn't play