So most of the day I’ve been working on Door Animations using Roblox’s Animation Editor. I’m proud of it. However while testing on a Studio Sever, I found out something with the animations.
The driver unlocks the doors and the passenger presses the button to open it. It should play the door opening animation, but it doesn’t for the passenger, only the driver. It’s the same with door closing. I’ve attached a video here.
More information:
Animations are located in the doors:
(This is Door 1 but Door 2 is pretty much the same)
I hope I can get some help because it would be a shame to have to scrap this, it’s one of my favourite things I’ve developed!
I had trouble with animations only playing on the server or for one client before, what I did to fix it was set the priority of the animation in the animation editor itself instead of the script. That fixed it for for me(don’t ask me how).
local open = false
local AnimationController = script.Parent.Parent.Parent.Parent.LeftDoors.LeftDoor1Anim:WaitForChild("AnimationController")
local DoorOpenAnimation = AnimationController.DoorOpen
local DoorOpeningAnimation = AnimationController:LoadAnimation(DoorOpenAnimation)
script.Parent:WaitForChild("ClickDetector").MouseClick:connect(function()
if open == false or script.Parent.Parent.Parent.TrainVariables.LeftDoor1Open.Value == false then
script.Parent.Parent.Parent.TrainVariables.LeftDoor1Open.Value = true
script.Parent.Parent.Parent.Parent.LeftDoors.LeftDoor1Anim.DoorLeft1.DoorOpen:Play()
open = true
DoorOpeningAnimation:Play()
end
DoorOpeningAnimation.Stopped:Connect(function()
DoorOpeningAnimation:AdjustSpeed(0)
DoorOpeningAnimation.TimePosition = DoorOpeningAnimation.Length
end)
end)
I don’t really want to post my entire RemoteEvent script to be honest…
If an Animator is a descendant of a Humanoid or AnimationController in a Player’s Character then animations started on that Player’s client will be replicated to the server and other clients.
If the Animator is not a descendant of a player character, its animations must be loaded and started on the server to replicate.
The Animator object must be initially created on the server and replicated to clients for animation replication to work at all. If an Animator is created locally, then AnimationTracks loaded with that Animator will not replicate.