Coupled trains don't move on other players screens

Hello,

I’m working on a train system and I’ve stumbled accross an issue, when I spawn a dual car unit (non coupled train) the train will drive fine on all screens but, if I spawn a train that has mulitple dual car units (Coupled train) the train doesn’t move on other players screens.

I have confirmed that network ownership gets set as supposed to, so this isn’t the issue.
I’ve also tried to turn streaming enabled off but that doesn’t change anything.
The train never has any anchored parts either.
I’ve also tried to mess around with the workspace properties and no luck.
I’ve also tried different couplings instead of rod constraints and still nothing.
If I manually build and couple the train myself (Duplicate the unit, move it behind the other, and build the rope constraints between the 2 cars) and just register it, it seems to work perfectly fine but if I click the spawn button and the script builds and spawns the train it work (It will move on my screen but won’t move on my other screen).
Cloning a spawned train and pasting it so its already there when you joined doesn’t work either.
I’m also positive that the trains that are manually made and spawned are identical aswell.

Heres a look,
The 2 purple parts are part of the broken train.
The 2 red parts are part of the working train.

These ones are where 2 units are coupled.

Carriages coupled:


Units coupled:

Heres the full train

This unit drives perfectly fine when on its own but if I couple it to another unit/set via script it won’t work but if I manually couple it it would work.

Network ownership on this spawned train

Does anyone have any ideas on how I can fix this?

Not sure if this is a bug, building/rig issue, scripting issue or what but please help!

Anybody have any ideas that could fix this issue?

To add,
If I move the train that moves only on my screen but doesn’t move on the other players screen, but then I rejoin to that server the train moves to the last position but still doesn’t actually drive when im driving it.

Probably not in art design support. This is a scripting problem. If you’re creating the joint on the client that might cause that. If this is all server side and the player driving it has network ownership over it then you might have found an engine bug.

I’ll move it, had it here because I wasn’t sure if its to do with the rigging or the scripting of it.

On the client, I press a button which spawns a train and builds the train based on how many carriages I pick (2 for one unit, 4 for 2 units coupled, 6 for 3 units couples and so on) and the train moves with LinearVelocity.LineVelocity which the value changes from the client and network ownership is applied on the server.

If I you know, manually do what the script does it will work but if the script does it it won’t work.

I’m working on a new version right now thats just the chassis and without the train and its features so I’ll see how that goes.

Is the button firing a remote event and having the server clone/setup the instances, or are you doing it all on the client? If you’re doing it all on the client then that’s why: those things don’t exist for anyone other than the client that made them. That’s filtering enabled.

Yeah, theres a remote event that does it, sorry forgot to add that.

When I finish with this place file I’ll upload it here if the problem persists.

Seems to work fine when I spawn a train in this version… don’t wanna re-rig the entire thing lol.

Some how removing this block of code fixed it?.. I’ll test a bit more before I mark this.

Update: Yep, this was the issue, don’t know why but whatever… (This just toggles the walkway at the end doors, so I can walk between units.)

for _, Part in NorthCoupler.Coupled:GetChildren() do
	Part.Transparency = 0
end

for _, Part in NorthCoupler.Uncoupled:GetChildren() do
	Part.Transparency = 1
	Part.CanCollide = false
end

for _, Part in SouthCoupler.Coupled:GetChildren() do
	Part.Transparency = 0
end

for _, Part in SouthCoupler.Uncoupled:GetChildren() do
	Part.Transparency = 1
	Part.CanCollide = false
end
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.