I was trying to do a crouch animation for my game. This LocalScript was in StarterCharacterScripts and a child which was an animation called "Animation". The output doesn't show any errors but the player doesn't carry out the animation. Here's the script:
local UserInput = game:GetService("UserInputService")
local humanoid = script.Parent:WaitForChild("Humanoid")
local Animation = humanoid:LoadAnimation(script.Animation)
local Running = false
UserInput.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.C then
if not Running then
Running = true
Animation:Play()
humanoid.WalkSpeed = 10
else
Animation:Stop()
Running = false
humanoid.WalkSpeed = 16
end
end
end)

1 comment
use the animation track inside the humanoid and try loading the animation on a server script