My animation is working on client but on server it shows the arms lowered

So this is my first post on the DevForum and I would like some support from other developers.

I am currently having problems with animations, basically what is happening is that the animation is working perfectly on the client side but on the server side it shows the animation with the arms down and sometimes with the arm changing position.

I have already tried changing the priority of the animation, playing the animation on the server side, checked the Tools properties and tried activating the ReloadAssets options.

Local Script

 --:: Modules ::--
local Global = require(game:GetService("ReplicatedStorage").Modules.Globals)

--:: Variables ::--
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character ~= nil
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local ServerEvent = _G.Remotes:WaitForChild("ServerModuleEvent")
local Animate =  Character:FindFirstChild("Animate")
local AnimateId = _G.ReplicatedStorage:WaitForChild("AnimationsID")
local idle = Animate:FindFirstChild("idle"):FindFirstChild("Animation1")
local Equipped = false

_G.ContextAS.LocalToolEquipped:Connect(function(Tool)
	Equipped = true
	ServerEvent:FireServer("Equip","Equipped")
	idle.AnimationId = AnimateId:FindFirstChild(Tool.Name.."Idle").Value
	Humanoid:ChangeState(Enum.HumanoidStateType.Landed)
end)

_G.ContextAS.LocalToolUnequipped:Connect(function(Tool)
	Equipped = false
	ServerEvent:FireServer("Equip","Unequipped")
	idle.AnimationId = AnimateId:FindFirstChild("Idle").Value
	Humanoid:ChangeState(Enum.HumanoidStateType.Landed)
end)

Script

--:: Modules ::--
local Global = require(game:GetService("ReplicatedStorage").Modules.Globals)

--:: Variables ::--

local WeaponFolder = game:GetService("ServerStorage"):WaitForChild("Weapons")
--:: Void ::--
return{
	TripleSword = function(Action,Player,WeaponName,Character)
		if Action == "Equip" then
			local TripleSwordTool = Character:WaitForChild(WeaponName)
			local TripleSwordModel = WeaponFolder:WaitForChild(WeaponName).Handle:Clone()
			local TripleSwordModel2 = WeaponFolder:WaitForChild(WeaponName).Handle2:Clone()
			local TripleSwordModel3 = WeaponFolder:WaitForChild(WeaponName).Handle3:Clone()
			TripleSwordModel.Parent = TripleSwordTool
			TripleSwordModel2.Parent = TripleSwordTool
			TripleSwordModel3.Parent = TripleSwordTool
			Global.CreateWeld(TripleSwordTool:FindFirstChild("Handle2"),Character:FindFirstChild("Left Arm"),TripleSwordTool:FindFirstChild("Handle2"),CFrame.new(0,-1,-.2)*CFrame.Angles(math.rad(90),0,math.rad(180)))
			Global.CreateWeld(TripleSwordTool:FindFirstChild("Handle3"),Character:FindFirstChild("Head"),TripleSwordTool:FindFirstChild("Handle3"),CFrame.new(0,-.2,-.6)*CFrame.Angles(math.rad(180),0,math.rad(270)))
		elseif Action == "Unequip" then
			local Backpack = Player:WaitForChild("Backpack")
			local Weapon = Backpack:WaitForChild(WeaponName)
			Weapon:FindFirstChild("Handle"):Destroy()
			Weapon:FindFirstChild("Handle2"):Destroy()
			Weapon:FindFirstChild("Handle3"):Destroy()
		end
         end,
}

If anyone has any ideia on how to solve this please reply to this Topic.

Run the animations from local player’s client script if done so it should replicate correctly both to server and other players

1 Like

Ty for replying to my Topic, but isn’t changing the idle AnimationId in client and changing Humanoid State the same thing as doing a :Play() in a animation, I’m not sure about it as it is my first time actually using animation.

Animation tracks are usually ran from client because It’s more stable, if you try to run animation on another object from your client and not their client then you will not be able to see the animation

1 Like

I remember having a similar issue where my animations would play correctly on the client, but wouldn’t be the same server side. What I see you did similar to me to recreate this issue is change the characters idle animation Id that comes with the characters Animate script.

Unfortunately I did not find a way to fix this with taking that approach. Instead what I did was make a LocalScript and place it within StarterCharacterScripts. This script would utilize Humanoid.GetState(), Humanoid.MoveDirection and or Humanoid.Running to depict when the character is idle / running. Depending on what’s returned by these functions I would play the idle/running animation via Animator:LoadAnimation():Play().

1 Like