#Replacing default animations through script not working

1 messages · Page 1 of 1 (latest)

inner jolt
#

I am trying to replace animations of the spawned player but nothing seem to change

local animate = game:GetService("Players").LocalPlayer.Character:WaitForChild("Animate")
local char_animations = {
    idle = 136238818808538, run = 138483999506918, jump = 134618020183279
}

for animation_name, animation_id in pairs(char_animations) do
    for _, animation_track in ipairs(animate[animation_name]:GetChildren()) do
        if animation_track:IsA("Animation") then
            animation_track.AnimationId = string.format("rbxassetid://%d", animation_id)
            print("replaced!")
        end
    end
end

am I doing something wrong?
it's in a client script in starter character scripts.

Do I need to do something extra?