Why doesn't the animation play?

I’m trying to make it so an animation is put on the character as soon as it joins but it isn’t playing. I checked and the event is firing the animation just doesn’t play.

local event = game:GetService("ReplicatedStorage"):WaitForChild("Joined")

event.OnClientEvent:Connect(function()
	local player = game.Players.LocalPlayer
	local char = player.Character
	local hum = char:WaitForChild("Humanoid")
	local Anim = Instance.new("Animation")
	Anim.AnimationId = "rbxassetid://11221496428"
	Anim.Parent = hum
	
	local animationTrack = hum:LoadAnimation(Anim)
	animationTrack:Play()

end)
1 Like

Does the event fire? Try loading the animation using the animator hum.Animator

1 Like

I checked by printing that the event is firing it’s just a problem with the animation part of the script.

did you make the animation or not (as in save it and get the ID)

yes, and I made sure to upload it to the group which the game is made through as I saw another post where someone’s animation wasn’t playing because it wasn’t made by their group.

ok so how is the event fired by the way

Maybe the animation id? Try publish the animation again.

@HalloweensChaos
Can you try removing the WaitForChild?

If you want replace it with FindFirstChild or .Humanoid

The event is fire by using FireAllClients.

not the problem

I just tried this and it still wouldn’t play.

1 Like

Has the player’s character loaded in prior to the event being fired? Because if the players character isnt loaded in, the animation wont play, or the animation is being overrided by something

1 Like

I’m pretty sure the player should be loaded in but is there a way to check?

I believe there is a function known as CharacterAppearenceLoaded or something among the lines of that

Try local char = player.Character or player.CharacterAdded:Wait()

The CharacterAdded event from the Player returns the character so it should work too.

1 Like