Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[SOLVED] Animations not replicating at all?

These animations play perfectly fine on the client playing them but they don't play at all for the server nor any other client as can be seen in this gif. Everything should be set up correctly but in case I'm missing something, here's the character's hierarchy. The character has its network owner set to the correct player and works great otherwise.

Here's the only relevant piece of code on the server which initializes the character:

local function initCharacter(model)
	local humanoidObject = script.humanoidObject:Clone()
	humanoidObject.Name = "Humanoid"
	humanoidObject.Parent = model
    
	humanoidObject.AnimationPlayed:Connect(function(track)
		--    This event never fires
		print(track.Animation.Name)
	end)
    
	script.jumpVelocity:Clone().Parent = model.PrimaryPart
    
	local gyro = script.bodyGyro:Clone()
	gyro.CFrame = CFrame.Angles(0, math.rad(180), 0)
	gyro.Parent = model.PrimaryPart
    
	model.Parent = workspace
end

And here's the function to play the animations, on the client:

function Character:playAnimation(name)
	local track = self:continueTrack(name)
	if not track then	
		local humanoidObject = self.model.Humanoid		
		track = humanoidObject:LoadAnimation(self.animations[name])
		
		self.animationTracks[name] = track
		track:Play()		
	end
	return track
end

Again, works great on the client. Character.animations points to a folder containing all the animation objects. This folder is inside StarterPlayerScripts (so the client clones them inside the PlayerScripts folder) thus they only exist on the client. I first thought this may have been the issue and threw the animations folder inside ReplicatedStorage but the issue still persisted.

1 answer

Found the solution. It was another thing I did not see being mentioned in the wiki, at all. The Humanoid requires an "Animator" object inside it.

This discussion is preserved as it was. New answers, comments, and votes are closed.