Bug with player controlled trains

Right so, first post on the devforum so excuse me if I’m lacking anything here.

So I’ve been having this issue for a while, where in player driven trains I’ve made, the trains get “stuck” when there are multiple people in the server at once. When the train is spawned, you can go inside it into the vehicleseat, and it won’t move at all. The trains themselves use a bodyvelocity system to move, using vehicleseat.throttle inputs as the control. The thing with this issue is, the trains never experience this stuck issue whenever it’s in singleplayer. Even weirder, if you hold W for around a minute, the train may suddenly be controllable again, but will start by rocketing forward at full speed.

So far, the most successful thing at reducing the frequency of, but not eliminating the bug is having the train spawn in with its base anchored for 5 seconds, before it is automatically unanchored. This doesn’t always work, but I have seen it cause a noticeable decrease in the occurrence of this bug. From an hour ago I’ve figured out how to recreate the bug in a studio test server, in which I’ve noticed the following:

  • When the train is stuck, the bodyvelocity IS actively responding to throttle inputs.
  • There is no part of the vehicle that’s anchored
  • The core script is functioning as intended

I frankly don’t know how to solve this at this point, so if anyone is able to help me to isolate this issue, it would be a great help. Thanks for reading this far.

1 Like

Oh and if it matters at all, the train uses 4 ball gliders per carriage to stay on the tracks.

1 Like

Have you tried setting the network owner of the part that’s supposed to be moved to the player that’s controlling the train?

1 Like

This seems to have done the trick in my test place, I’m still relatively new to scripting so I didn’t know to try this before, thanks for the help.