event.OnServerEvent:Connect(function(plr)
print("Debug")
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local animTrack = hum:LoadAnimation(anim)
animTrack:Play()
end)
Debug is printing but the animation still does not play (server script)
Animations should always be played locally and will automatically replicate, also ensure that the priority of the animation is action in the animation editor.
already tried playing it locally (but you’re supposed to be able to play it on the server), and it is set to action (even tried manually setting it, inside the script)
I’m very certain you can’t play animations on the server. If that doesn’t work, then set the Animation Priority in your animation editor, not in the script. Also don’t add the .CharacterAdded or :WaitForChild() because if they die, it will cause problems.
You can play animations on the server, it’s just more reliable and efficient to do on the Client side since, they replicate and there’s no much delay to it.
Yea honestly you shouldn’t be playing animations on the server. The preferred way is to do it on the client, and where the animation is located might have an effect on playing the animation.