Custom animations

Hi! So I am making a custom Idle animation for my game and this is the script I am using to set it:


local idleAnim = "rbxassetid://14495626881"


game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAppearanceLoaded:Connect(function(char)
		local hum = char:WaitForChild("Humanoid")

		local animateScript = char:WaitForChild("Animate")

		animateScript.idle.Animation1.AnimationId = idleAnim
		print(animateScript.idle.Animation1.AnimationId)
	end)
end)

It is not resetting the animation. But when I am in-game and I go to the explorer and change it manually, it works.

EDIT
I changed the script but still have same problem.

2 Likes

Instead of plr.CharacterAppearanceLoaded I just used plr.CharacterAdded and it worked perfectly for me.

local customIdleID = "0"

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local anim = char:WaitForChild("Animate")
		anim.idle.Animation1.AnimationId = customIdleID
	end)
end)
1 Like

You will also need to edit whole animate script instead of changing animation id from values that animate script does have.

1 Like