Hello, how I can reach the loaded animation track in humanoid?
local plr = game.Players.LocalPlayer
local chr = plr.Character
local hum = chr:WaitForChild("Humanoid")
local anim = "animationID"
local track = hum:LoadAnimation(anim)
function somethingHappened()
track:Play()
-- I want to stop Jump, Walk, or any animation that plays in humanoid this line
end)
I suggest instead of using anything animation related on the humanoid to do it on the Animator (this is parented to the humanoid).
So animator:GetPlayingAnimationTracks() would be correct instead
If you wish to cancel any animations playing by roblox get the assetId of the asset and use:
local productInfo = game:GetService("MarketPlaceService"):GetProductInfo(assetId)
Then you would check if
if productInfo.Creator.Name == "Roblox" then
-- Stop
end
Else you could only let your animations play with:
if productInfo.Creator.Id ~= game.CreatorId then
-- Stop
end
Another thing if you wish to cancel the default roblox animations make a local script, put it inside StarterCharacter and have the following code inside of it:
local AnimateScript = script.Parent:WaitForChild("Animate")
AnimateScript:Destroy()
script:Destroy()
If you wish to make custom animations then player the game, copy the local script located inside your character then copy it, change the name so it’s not “Animate” put it inside StarterCharacter and have the code above without script:Destroy() instead you could use script.Name = "Animate" if you really feel like it.