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.
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.)
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.
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.
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