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)
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.
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.
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.
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.
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.
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.
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.