Animation does not work on Client, but kind of works on the Server?

Hello Everyone!
I have been making a custom Tool System for one of my new Roblox Games, but it does not seem to work in the Client, but kind of works on the Server.

Code for creating a Tool and the animation:

--============================================
--// MODULES

local TOOL_DATA = require(script.Tool_Data);

--============================================
--// Variables

local TOOL_MODELS = script.Models;

--============================================
--// SETTINGS

local Animations = {
	Hold_Animation = "rbxassetid://92949079562954";
}

local BSG_Tool = {}
-- Module Script (Inside Replicated Storage)
--//
--[[

]]
function BSG_Tool.Create_Tool(Player: Player, Tool: string): ()
	local NEW_TOOL_MODEL: Model = TOOL_MODELS[Tool]:Clone();
	if not NEW_TOOL_MODEL then return end;
	-- Initiate Variables
	local GIVEN_TOOL_DATA = TOOL_DATA[Tool];
	local PLAYER_CHARACTER = (Player.Character or Player.CharacterAdded:Wait());
	if not PLAYER_CHARACTER:FindFirstChildOfClass("Humanoid") then return end;
	local PLAYER_RIGHT_HAND: BasePart = PLAYER_CHARACTER.RightHand;
	local PLAYER_ANIMATOR = PLAYER_CHARACTER:FindFirstChildOfClass("Humanoid"):FindFirstChildOfClass("Animator");
	-- Return if Player Animator does not exist.
	if not PLAYER_ANIMATOR then return end;
	local MOTOR_6D = Instance.new("Motor6D");
	local NEW_ANIMATION = Instance.new("Animation");
	local ANIMATION_TRACK: AnimationTrack = nil;
	MOTOR_6D.Part0 = PLAYER_RIGHT_HAND;
	MOTOR_6D.C0 = GIVEN_TOOL_DATA.Offset_CFrame;
	NEW_ANIMATION.Name = "Hold_Animation";
	
	NEW_TOOL_MODEL:PivotTo(PLAYER_RIGHT_HAND.RightGripAttachment.WorldCFrame);
	MOTOR_6D.Part1 = NEW_TOOL_MODEL.Handle;
	MOTOR_6D.Parent = NEW_TOOL_MODEL.Handle;
	NEW_ANIMATION.AnimationId = Animations[NEW_ANIMATION.Name];
	
	NEW_ANIMATION.Parent = NEW_TOOL_MODEL; -- Put newly made Tool into the Player's Character.
	ANIMATION_TRACK = PLAYER_ANIMATOR:LoadAnimation(NEW_ANIMATION);
	
    NEW_TOOL_MODEL.Parent = PLAYER_CHARACTER;
	ANIMATION_TRACK.DidLoop:Connect(function() -- Check to see if Animation actually Plays
		print("aa")
	end)
	
	ANIMATION_TRACK:Play();
	print("b")
end

return BSG_Tool

What i’ve done is remove any custom Welds / Motor6Ds / Parts in the Player’s Character because that could be one of the issues, but it’s not, and then i implemented prints inside a DidLoop Connection to check to see if the animation actually runs.

And it only does so on the Server but not the Client, i have tried almost everything and it’s really weird:

Client View:

Server View: (Also seems to overlap normal ROBLOX Core Animations, THIS IS FIXED NOW)

Animation Editor:

The animation also has Looped set to true and has a AnimationTrack.Priority set to Action.
I’ve tried a lot, but nothing seems to work, could someone help?
Thanks for reading.

1 Like

Is the script playing the animation client or server side? I suggest playing the animation on the client because it gets automatically replicated to the server

1 Like

I have both a Local Script and ServerScript loading the Tool / Animation, but only the Server runs the animation, i have ran this just the LocalScript (same for the ServerScript) and got the same result.

(I do not care about replication to the Server, i just want it to work on the Client because then it would replicate to all Clients)

Just loading the LocalScript:

(The printed “b” means the Play() Funtion was called, but “aa” was not printed so the animation didn’t move anything).

What is the animation priority? I recommend having it at Action3 if it isn’t already that

In the post i mentioned it being Action, i previously had it on Action4, i will test with all the Action Priorities and reply back.

I just tested with every single Animation Priority via the Animation Editor and the Issue still persists: the Client does not move any parts for the Animation.

One of my only guesses at the moment is maybe it’s something to do with ROBLOX’s default Animate Script:


But it just doesn’t make sense on why a ROBLOX Core Script will mess with my code