Hi yal! Im currently making a automatic peoplemover (train) system with multiple cars that utilizes tween w/ cframe to move.
My current system is a very tradional Cframe + Tween System, With multiple nodes on the track that the train moves (tweens between) to to reach its destiantion station.
For better server-side performance, The Tween is done entirely on the client, Sent via RemoteEvents.
The main issue i have encountered is having the multiple carriages of the train move together with a constant distance between them, Currently the distance between cars is very choppy and laggy.
Before i encountered this issue, I have nodes of the track spaced between equally by the distance between 2 cars. So if car1 is at node 4, car2 would be one node behind (node3) and so on Then the script will tween all cars at once instead of independently. This made the distance between 2 cars equal throughout the entire route and looked good. The main issue i encountered with this method is that it does not allow for nodes that aren’t equally spaced apart, which is very difficult especially to do when trying to make a single track branch out into 2 tracks then stop at the station at the same space on one axis.
So to solve this, I instead made every car perform their tweens individually (On different threads), This Utilizing Coroutines. This adds the ability for the train to move between several nodes that arent equally spaced apart, But this has introduced the current issue I’m facing, Unequal spacing between cars making the system look janky and laggy.
So im currently looking for any alternative movement systems that utilize the same cframe based system (not wanting to make a alignposition / rotation system since it utilizes physics, thus increasing possibility of server lag.)
I Have also looked at various DevForum Articles, Videos and The Developer Hub, Many of which helped me to get to this stage but my scripting knowleage isnt very great and i havent been able to understand some of them as much as i should.
Any help, advice or small comments are very much apprecitated!
(This is also my first time writing a Scripting support post, So it might be a bit hard to read. I apologize in advance!)
^^ Here is a video of my system. As I have mentioned, The distance between the cars changes during the route and is very janky looking.