Need help with custom idle animation not showing correctly

I’m trying to set a custom idle animation for when a class is chosen through LoadCharacter() then changing the character’s idle animation id.

However when the character is spawned in, the animation appears to be fine on the client but displays incorrectly from others.

Client’s view:
image
Others view:
image

I have tried resetting the character’s animations before playing the custom one, but did not work.

Server script: (“ClassValue” is added after LoadCharacter in a different section):

replicatedStorage = game:GetService("ReplicatedStorage")
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAppearanceLoaded:Connect(function(char)
		char.Humanoid.WalkSpeed = 0
		char.Humanoid.JumpPower = 0
		if char:WaitForChild("Data"):FindFirstChild("ClassValue") ~= nil then
			local hum = char:WaitForChild("Humanoid")
			local animator = hum:WaitForChild("Animator")
			local animScript = char:WaitForChild("Animate")
			if char.Data:WaitForChild("ClassValue").Value == "Boxer" then
				animScript.idle.Animation1.AnimationId = game.ReplicatedStorage.BaseAnimations.Boxer:WaitForChild("BoxIdle").AnimationId
				animScript.idle.Animation2.AnimationId = game.ReplicatedStorage.BaseAnimations.Boxer:WaitForChild("BoxIdle").AnimationId
				animScript.run.RunAnim.AnimationId = game.ReplicatedStorage.BaseAnimations.Boxer:WaitForChild("BoxMove").AnimationId
				animScript.walk.WalkAnim.AnimationId = game.ReplicatedStorage.BaseAnimations.Boxer:WaitForChild("BoxMove").AnimationId
				animScript.jump.JumpAnim.AnimationId =  game.ReplicatedStorage.BaseAnimations.Boxer:WaitForChild("BoxJump").AnimationId
				animScript.fall.FallAnim.AnimationId =  game.ReplicatedStorage.BaseAnimations.Boxer:WaitForChild("BoxFall").AnimationId
			end
		end
	end)
end)
1 Like

U dont have 2 animations playing at same time?

3 Likes

Nope, only changed the animation id of the default idle

idle.Animation2 is to prevent arms from swaying

1 Like

Turns out the animation on the character wasn’t cleared correctly before running the custom ones,

using

for i,v in pairs(player.Character.Humanoid:GetPlayingAnimationTracks()) do
	v:Stop()
end

Before setting the animations made it work

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.