Animations not visible on the server despite being played on it

Hey everyone, so I started having issues with animation replication since it was announced that using :LoadAnimation() directly on Humanoids and AnimationControllers will be deprecated.

Basically I have a train that is physics-based and it has animated doors. The player who’s driving the train has the network ownership of all the train parts. However, door animations are visible only on the driver’s side despite the animation being played on the server. Animation’s priority is set to Action, I create the Animator instance on the server before the train spawns and :LoadAnimation() is called on the Animator instance. It becomes visible to everyone once the server has network ownership of the parts. However, I don’t want the server to be the network owner since there’s gonna be many trains and that would cause too much stress for the server taking care of all physics simulation.

Has anyone else experienced it too? Does anyone have a solution to this?
Any answers are appreciated! Let me know if you need any more info. :slightly_smiling_face:

Hey! I suggest spliting your script into a Client Ended as well as a Server Side script. If its all on the Client (which would probably be since you’re loading the animation on the character - no one else should be able to see it.)

You can do this through the use of Remote Events and Remote Functions! Bindable Events and Functions | Roblox Creator Documentation

I think you misunderstood my issue. I am animating train doors not a player character. It all worked fine before Roblox announced that they are deprecating using :LoadAnimation() directly on Humanoids and AnimationControllers. I do load the animation on the server.

Is this what you are looking for?

This is what I am talking about - yes, I still have the issue even when loading the animation directly on the Animator instance.

Edit: I was going to fill in a bug report but unfortunately I am not Regular so I am unable to do that.

Why don’t you try adding the WaitForChild() before loading your animation? If you can provide the snippet of code, I think I can help you much better. I believe the reason why it isn’t working (assuming since I don’t know what your code is) is mainly due to your code still utilizing Humanoid:LoadAnimation() or AnimationController:LoadAnimation() since both of them has been depreciated.

I’ve skimmed through that post - I think Animator | Roblox Creator Documentation can help.

Sorry if this is confusing - I can help you much better if you had a sample code I can look into.

This is the code, it’s on the server, and the Animator is created on the server when the train spawns as I mentioned in the original post.

local station = Workspace.Stations[nextStn.Value]
local side = (destination.Value == "Paral·lel" and station.StationPart2.Side) or station.StationPart1.Side
local anim = TRAIN.Animations.DoorsAnim

for _, coach in pairs(TRAIN.Animations:GetChildren()) do
	if coach:IsA("Model") then
		for _, animController in pairs(coach[side.Value]:GetDescendants()) do
			if animController:IsA("AnimationController") then
				local track = animController:WaitForChild("Animator"):LoadAnimation(anim)
				track:Play()
			end
		end
	end
end