#the animation for the speed doesnt work

1 messages · Page 1 of 1 (latest)

severe yoke
#

local humanoid = script.Parent:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator")

local runAnim = Instance.new("Animation")
runAnim.AnimationId = "rbxassetid://616163682"

local track = animator:LoadAnimation(runAnim)
track:Play()

local function updateAnimSpeed()
local baseSpeed = 40
local currentSpeed = humanoid.WalkSpeed
track:AdjustSpeed(currentSpeed / baseSpeed)
end

humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(updateAnimSpeed)
updateAnimSpeed()