What constraint should I use for gangway of trains?

I am now making a multiple carriages train that runs with basepart velocity. However,the current constraint I use to connect carriages has a bug. The carriage might be detached and/or derail. What constraint should I use for my train? (The train must be able to run at high speed when turning)

Here are some images:


unknown-244

1 Like

A rod constraint should fit your case best. You’ll avoid bouncing you’d get with a rope constraint and it’ll act as a double joint which is much more stable at turns.

2 Likes

The train will stuck on the track when it is turns,are there any better solutions?

That’s a different issue. Your train probably doesn’t have railroad trucks, which means your cars are too long and get stuck on the rails. Modern rail cars have a pairs of railroad trucks which freely rotate at the connection.

This is a railroad truck:
Railroad_truck,_FM55-20.Fig8-8

4 Likes

I’m just adding on to what nooneisback said

A railroad truck aka bogie, is the platform that the wheels are attached to, and then the bogie is attached to the main train platform with a hinge

You put the main train body / model on top of the platform and weld them together.

The wheels are also connected to the bogie using a hinge.

Also, there are 2 bogies on a train / train car. One at the front, and one at the back.

2 Likes

Does a BallSocketConstraint | Roblox Creator Documentation work for you?
It allows the two items to be locked together, but rotate on all axes.
A RopeConstraint or RodConstraint would do the same if you had the length set to zero, but this would probably cause some extra ‘elasticity’ in the joints.
As @nooneisback mentioned the RodConstraint would be better if you were joining the carriages themselves, but if you put a BallSocketConstraint attached to the bogeys it might help out and would align the bogies to each other, as well as the whole setup to the track and allow it to corner.

1 Like

I used balls to guide the train.
It won’t stuck if it were a 1 carriage train though.

It did help but there will be a gap between gangways. Do I have to set the length of the rod shorter?

Yep, make it long enough for them not to collide between each other.

You can change where you put the Constraints as well as how long the Rod Length will be.

If you move the Constraints make sure to check the Actual Length and the Rod Length in the Properties to make sure they match. If they don’t there will be a noticeable change in the colour of the Rod (Orangey brown to red) when those values don’t match.

For connecting bogies to trains, it’s better to use hinge constraints for a rudimentary connection.

I didn’t mean using BallSockets to join the bogies to the trains. I meant that instead of using the BallSockets on the carriage ends (which may cause alignment issues when the radius of a track corner changes quickly from one curve to the next) you should join the bogie at one end of the carriage to the next carriage’s bogie using a BallSocket. This would keep all the wheels aligned to the track better, and the carriage ends being misaligned wouldn’t matter.

That’s… not how train couplings work?

Trains are connected using essentially glorified rod mechanisms. This is especially important for trains where passengers are able to move between carriages, as if the connection’s pivot point was too far from the carriage end, navigation between vehicles would be exceedingly difficult. For this reason, it’s not only accurate but recommended to use rods between train carriages, unless the train uses a special form of coupling known as a Jakobs bogie, which I’ll explain now.

Jakobs bogies are special forms of train bogie, wherein one bogie is shared between two carriages. Often times, it’s connected to one carriage using a classic pin-style link (the same as a traditional bogie which can only rotate left or right), with the other carriage “floating” on top.


(credit to David Gubler)

The large pin on the right carriage fits into the slot on the left carriage, and the bogie link pin (the thing pointing down on the left of the image) is connected to the left carriage.

I’m wondering - seeing as @HR_Gameson0630’s vehicle looks like a permanently coupled metro unit, would a Jakobs bogie be appropriate?

Yes, but I’m thinking more of how things would work with Roblox physics.
For example, imagine a sharp left turn followed immediately by a sharp right (an S bend) with a couple of carriages and their hinge points at the transition from the left curve to the right. Not a real world situation but for argument’s sake.
The first car’s last bogie is just starting the right turn, but the centerline of the car (after the bogie) is actually to the left of the track centerline since the car’s bogies are already travelling around the RH curve.
The last car’s first bogie is just coming off the left turn, so the centerline of the end of the car (ahead of the bogie) is now to the right of the track centerline. The car’s bogies are both still turning around the LH curve.
If you put any sort of rod between the cars it would work, giving you 4 pivot points to work with between 2 cars (2 bogie hinges and 2 ends of the RodConstraints). In Roblox’s case if you have too many Constraints it gives more of a chance for it to mess up.
My way of thinking is that if you have 1 less joint per coupling on a 6 car train that gives you 5 less pivot points in the system.
That’s why I suggested joining the bogies between cars with a BallSocket so each has its Attachement centered between the bogies, right where the coupler would be between cars.
The other thing I was thinking was that this would help keep the bogie from each car aligned to the track better since it isn’t just free to pivot whatever way it desires if you hit a bump. It would be limited by the connection to the next car’s bogie.

Of course this is only hypothetical. Just trying to make the physics of the situation work better in my head.