You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I’m making a script that plays and Audio for when the player’s “Right Foot” and “Left Foot” touches the ground. I’m using a Custom animation with a labeled KeyFrame Called “Right Foot” and “Left Foot”.
https://gyazo.com/a7c3d3bc822673a5fd13e68f56e87737
The main problem is getting the AnimationTrack since I am using Roblox’s default “Animate” script. I know that I can make my own custom animation and just put it inside the Animate script’s values. But I need to get access to that “RunAnim” AnimationTrack. I tried looking inside the “Animate” script but it was too hard for me to comprehend the codes in it and couldn’t find where the “RunAnim” animation track is.
- What is the issue? Include screenshots / videos if possible!
This is the “Animate” script that Roblox uses, I changed the animation IDs inside the script and in the Values of the script as well(run>RunAnim)
https://gyazo.com/d7d6ecdac1857e4365414f40e68d150e
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve read that u can get the animations that are played in the humanoid using lua Humanoid:GetPlayingAnimationTracks()
so I did, here is my script:
Player = game.Players.LocalPlayer
Character = Player.Character
function test(x)
x:GetMarkerReachedSignal("Right Foot"):Connect(function()
print("Right Foot")
end)
x:GetMarkerReachedSignal("Left Foot"):Connect(function()
print("Left Foot")
end)
end
Character.Humanoid.Running:connect(function(Speed)
if Speed > 0 then
local idk = Character.Humanoid:GetPlayingAnimationTracks()
for i,v in pairs(idk) do
if v.Name == "RunAnim" then
test(v)
end
end
end
end)
https://gyazo.com/c4022350583f0799af52ea1ec1ee32bd
Now in this script what it’s supposed to do is print “Left Foot” and “Right Foot” in a pattern, but there’s a bug that prints each one 10x, which is not what I want. (Note: although, this approach gave me close results)
I have a feeling that I’m approaching this issue incorrectly, so what do I do? How do I get access to those AnimationTracks
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.