Error with Character's moving aniamtion

So i am having a difficulty with a moon animation. I am making a multiplayer game, but the animation works just for me. Can yall help me in any way?Im Using Moon Animator

The code is actually from Roblox.This is the error for the other players:

Failed to load animation with sanitized ID rbxassetid://126580561114535: Animation failed to load, assetId: https://assetdelivery.roblox.com/v1/asset?id=126580561114535&serverplaceid=0 (x2)

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SoundService = game:GetService("SoundService")
local RunService = game:GetService("RunService")

local player = Players.LocalPlayer
local walkingSound = ReplicatedStorage:WaitForChild("WalkingSound")
local soundInstance = nil
local walkAnimationId = "rbxassetid://126580561114535"
local walkAnimation = nil
local animationTrack = nil

local function checkMovement()
     if not player.Character or not player.Character:FindFirstChildOfClass("Humanoid") then
          return false
     end
     local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
     return humanoid.MoveDirection.Magnitude > 0 and humanoid:GetState() == Enum.HumanoidStateType.Running
end

local function setupAnimation(character)
     local humanoid = character:FindFirstChildOfClass("Humanoid")
     if humanoid then
          local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid)
          walkAnimation = Instance.new("Animation")
          walkAnimation.AnimationId = walkAnimationId
          animationTrack = animator:LoadAnimation(walkAnimation)
          animationTrack.Looped = true
     end
end

local function updateSoundAndAnimation()
     if checkMovement() then
          if not soundInstance or not soundInstance.IsPlaying then
               soundInstance = walkingSound:Clone()
               soundInstance.Parent = SoundService
               soundInstance.Looped = true
               soundInstance:Play()
          end
          if animationTrack and not animationTrack.IsPlaying then
               animationTrack:Play()
          end
     else
          if soundInstance and soundInstance.IsPlaying then
               soundInstance:Stop()
               soundInstance:Destroy()
               soundInstance = nil
          end
          if animationTrack and animationTrack.IsPlaying then
               animationTrack:Stop()
          end
     end
end

player.CharacterAdded:Connect(function(character)
     if soundInstance then
          soundInstance:Stop()
          soundInstance:Destroy()
          soundInstance = nil
     end
 
     if animationTrack then
          animationTrack:Stop()
          animationTrack = nil
     end
    
     setupAnimation(character)
end)


if player.Character then
     setupAnimation(player.Character)
end

RunService.Heartbeat:Connect(function()
     updateSoundAndAnimation()
end)

Could the problem be due the wrong Animation Publishing?Im using Moon animator and i do not know how to publish an animation?

3 Likes