How to create a train bogie?

Hello Devforum!

I am create train bogies, but it works terribly, can anyone teach me how to make an advanced working train bogie. I only want it to stay on the tracks. I want a guide through not a roblox studio place. Thanks

Here’s a tutorial that helped me a lot.

Hopefully this helps you.
XII

When your going for a large scale moving models or parts like a train with carts, you shouldn’t rely on Roblox physics, because thats gonna lag and can even crash the players/server

As @julg0re said, you can read my tutorial when your going for a simple train with 0-3 carts, however that’s not gonna work for a train, its long also it have more than 3 carts

So you should probably use a CFrame based leviation thing to tween your train to the track, however you should know some basics as below

  • Vector3 values
  • CFrame
  • Tween service
  • Folders
  • Summation in Luau
  • Finite loops in Luau

These are some basic things you need to know to understand how this works correctly, and if you already know this, its good

Now, you should make a system which tweens the basepart of the train/carts to a track, also the walls/stuff on the train should be unanchored and welded to the Anchored base part of the train or cart whatever it is, so if you change the cframe of the base, the top stuff should also change with it, but you should note that, in jailbreak trains, when you jump, you stay on the train

The reason is your character also have the some movement force as the train, so this won’t make you go back, so this is how it works
But you need to know alot of stuff to make it, like gravity, angular velocity, linear velocity

Now coming back to the moving train, you should make it move, but using tween service, also this won’t affect performance much, because it uses almost no physics, but you could do something like raycasting to check if the track exist to avoid train going on a invisible track

Now you need to make a loop, a tween for your basepart to move to the top of every track, also the track should have the dot product as your base part dot product, and its quite long till here, I will show you my tutorial of roller coaster, which is based on tween, and you can also use it on tracks, and should maintain a delay between carts, so they all won’t end up at the same place or crash
Open tutorial

3 Likes