Weirdly replicating doors

The problem:
These doors are animated. However when passengers sit in the carriages the doors do not replicate until they stand up (excluding the middle coach)

The doors replicate for the driver but not for the passengers

(Animations with AnimationController)

2 Likes

Could you include some of your code that deals with the doors directly? Aswell as a GIF or something to show the issue? :slight_smile:

1 Like

My train runs on a modular system so… I’ll post the code which is run when the driving player pushes the door keybinds

(The driver would have network ownership)

function module.DoorTrigger(door)
	if Train.ActiveSeat.Value then
		if door == "Left" then
			door = Train.ActiveSeat.Value.Parent.Name == "Front" and "Left" or "Right"
		elseif door == "Right" then
			door = Train.ActiveSeat.Value.Parent.Name == "Front" and "Right" or "Left"
		end
	end
	
	if door == "Left" then
		if LICFlag == true then return nil end
		LICFlag = true
		local L = not LOpen
		if L == true then
			LOpen = true
			--Open Behaviour
			Train.Front.Cabin.InterlockLight.Material = "SmoothPlastic"
			Train.Rear.Cabin.InterlockLight.Material = "SmoothPlastic"
			Train.Front.Cabin.Speedometer.Screen.Drive.LDOpen.BackgroundColor3 = Color3.new(1,0,0)
			Train.Rear.Cabin.Speedometer.Screen.Drive.RDOpen.BackgroundColor3 = Color3.new(1,0,0)
			for _,v in pairs(LeftDoors) do
				spawn(function()
					v.Model.DoorRootMain.ChimeUnlock:Play()
					wait(.25)
					v.Model.DoorRootMain.UnlockActivate:Play()
					v.OpenAnim:Play()
				end)
			end
		else
			--Close Behaviour
			for _,v in pairs(LeftDoors) do
				spawn(function()
					v.Model.DoorRootMain.ChimeLock:Play()
					wait(1)
					v.CloseAnim:Play()
					v.HoldAnim:Stop()
					wait(1.25)
					v.Model.DoorRootMain.LockActivate:Play()
				end)
			end
		end
		wait(3)
		LOpen = L
		if ROpen == false and LOpen == false then
			Train.Front.Cabin.InterlockLight.Material = "Neon"
			Train.Rear.Cabin.InterlockLight.Material = "Neon"
		end
		if LOpen == false then
			Train.Front.Cabin.Speedometer.Screen.Drive.LDOpen.BackgroundColor3 = Color3.new(0,1,0)
			Train.Rear.Cabin.Speedometer.Screen.Drive.RDOpen.BackgroundColor3 = Color3.new(0,1,0)
		end
		LICFlag = false
	elseif door == "Right" then
		if RICFlag == true then return nil end
		RICFlag = true
		local R = not ROpen
		if R == true then
			ROpen = true
			--Open Behaviour
			Train.Front.Cabin.InterlockLight.Material = "SmoothPlastic"
			Train.Rear.Cabin.InterlockLight.Material = "SmoothPlastic"
			Train.Front.Cabin.Speedometer.Screen.Drive.RDOpen.BackgroundColor3 = Color3.new(1,0,0)
			Train.Rear.Cabin.Speedometer.Screen.Drive.LDOpen.BackgroundColor3 = Color3.new(1,0,0)
			for _,v in pairs(RightDoors) do
				spawn(function()
					v.Model.DoorRootMain.ChimeUnlock:Play()
					wait(.25)
					v.Model.DoorRootMain.UnlockActivate:Play()
					v.OpenAnim:Play()
				end)
			end
		else
			--Close Behaviour
			for _,v in pairs(RightDoors) do
				spawn(function()
					v.Model.DoorRootMain.ChimeLock:Play()
					wait(1)
					v.CloseAnim:Play()
					v.HoldAnim:Stop()
					wait(1.25)
					v.Model.DoorRootMain.LockActivate:Play()
				end)
			end
		end
		wait(3)
		ROpen = R
		if ROpen == false and LOpen == false then
			Train.Front.Cabin.InterlockLight.Material = "Neon"
			Train.Rear.Cabin.InterlockLight.Material = "Neon"
		end
		if ROpen == false then
			Train.Front.Cabin.Speedometer.Screen.Drive.RDOpen.BackgroundColor3 = Color3.new(0,1,0)
			Train.Rear.Cabin.Speedometer.Screen.Drive.LDOpen.BackgroundColor3 = Color3.new(0,1,0)
		end
		RICFlag = false
	end
end```
1 Like

Hm it is pretty weird, Maybe it’s the method in which you are animating the doors, Why not just use TweenService to move then smoothly for all clients?

Incase that could be the fix:

1 Like

Passengers meaning players? If that is the case and your doors are not anchored, then set the network ownership of the root of the doors (or the entire train assembly). There’s most likely a confliction with network ownership more than anything.

[UPDATE]
Found that the problem seems to affect rigs attached to an assembley

Animations dont play if there is a rig sitting in that assembley (and does not have network ownership)