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:
Others view:
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)