I just need to know how to do the GetMarkerReachedSignal event for the walking and running animations. How do i do that?
Can someone help me with this please?
Where would i put it in the Animate script?
Uhh, maybe a little late, but here’s how I did it in the default Animate script. You can find the function by searching, and the part I added is highlighted at the very bottom.
function playAnimation(animName, transitionTime, humanoid)
local roll = math.random(1, animTable[animName].totalWeight)
local origRoll = roll
local idx = 1
while (roll > animTable[animName][idx].weight) do
roll = roll - animTable[animName][idx].weight
idx = idx + 1
end
-- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
local anim = animTable[animName][idx].anim
-- switch animation
if (anim ~= currentAnimInstance) then
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop(transitionTime)
currentAnimTrack:Destroy()
end
currentAnimSpeed = 1.0
-- load it to the humanoid; get AnimationTrack
currentAnimTrack = humanoid:LoadAnimation(anim)
currentAnimTrack.Priority = Enum.AnimationPriority.Core
-- play the animation
currentAnimTrack:Play(transitionTime)
currentAnim = animName
currentAnimInstance = anim
-- set up keyframe name triggers
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
----------- new code ------------
currentAnimTrack:GetMarkerReachedSignal("Step"):Connect(function()
--play sound
end)
----------- new code ------------
end
end
1 Like
Thanks but i cancelled work on this game anyways lol and i’m working on smth new
1 Like