Serverside animation not replicating properly to client

I have an animation that is ran server side using an AnimationController

However, when I run the code I am getting different results between the client & server.

The server is displaying the correct output, whereas the client is not displaying the animation correctly.

Notes :

  • Filtering enabled is not enabled
  • Animation priority is highest priority
  • No other animations are running for this rig, on the client or server
  • Animation weight is full weight

Here is the code I have running :

local AnimationController = script.Parent.AnimationController.Animator
local ShellAscent = AnimationController:LoadAnimation(script.Parent.ShellAscent) -- Animation for shifting shells
local ShellLoad = script.Parent.Rotate.GunnersPit.GunnerPit.ProximityPrompt -- Proximity prompt you see in video
local X = 49 -- 49 is the 49th shell, "X" is added onto later, as the shell # shifts 
local DB1 = false -- Only used once, at the start of the video, it puts all the shells in place
local DB2 = false -- Used to stop double inputs during animation sequence

local function ShiftFunction()
	
	-- Makes selected shell transparent
	local TransparentShell = script.Parent.Shells:FindFirstChild("Shell"..tostring(X))
	local children = TransparentShell:GetChildren()
	for i = 1, #children do
		print(children[i].Name)
		children[i].Transparency = 1
	end
	--
	
	-- Small buffer between shell disappearing, and shells shifting
	wait(0.1)
	--
	
	-- Shift shells down one position
	ShellAscent:AdjustSpeed(.5)
	ShellAscent:GetMarkerReachedSignal(tostring(X)):Wait()
	ShellAscent:AdjustSpeed(0)
	X = X + 1
	--
	
end

script.Parent.Rotate.ShellShifting.Attachment.ProximityPrompt.Triggered:Connect(function(player)
	if DB2 == false then
		DB2=true
		if DB1==false then
			
			-- Load all shells into place
			ShellAscent:Play()
			ShellAscent:AdjustSpeed(0.5)
			ShellAscent:GetMarkerReachedSignal(tostring(X)):Wait()
			ShellAscent:AdjustSpeed(0)
			DB1=true -- DB1 is never used again
			--
			
		else 
			ShiftFunction()
		end
		DB2=false
	end
end)

First, create a script in the replicated storage. A normal server script. Now, go to the script’s properties and change RunContext to Client. Now, create a remote event also in replicated storage and use the server script to do :FireAllClients() on the remote event and in the script with the runcontext set to client, play the animation.