Train derailing at certain speed

Hello, I’m trying to make it so my train doesn’t derail when it achieves a certain speed, I’ve tried to change the density of some parts to make it heavier and expect the train to stay on the ground as much as possible since that was the last problem I had with this train. I’ve also tried to change the properties of some constraints that I use, like LinearVelocity for movement and HingeConstraints for the wheels.

2 Likes

I used to work on some trains and you need to make it so the train somehow stuck to the rails because of the physics engine?! (not so informed in this topic). As you can see around 60 the train begins to shake and I believe its because the engine roblox uses it keeps leaning to one way and hitting as it accelerates

2 Likes

Search the forums for “train @Scottifly”.
I’ve helped quite a few similar posts and have sample trains in different posts that I’ve made for others.

2 Likes

I tried some of the solutions you suggested to other users including the bogie that you published, but it still shakes and derails, I must be doing something wrong, but I’m not sure what, still, thank you for your help.

Thanks for your comment, I tried to stuck the wheels to the rails but it still derailed

1 Like

Just add an anchored transparent part in your rail model, just a bit above the wheels.
It will basically “lock” the wheels to the rails.

1 Like

What are the Densities of your Parts? If you have different Densities, or have some Massless, then Constraints don’t react well.
Are you using Union or MeshPart wheels?

Using the Studio Physics setting AreContactPointsShown can help troubleshoot issues like this since it may show you where parts are touching that you wouldn’t expect.

If that doesn’t help would you mind PMing me a simple copy of your train? I should be able to see what’s going on with it.

1 Like

Most of the densities of my bogie parts go from 10-15, I do have different densities and some parts are massless (Platform).

For the wheels I am using MeshParts and Unions.

Using the AreContactPointsShown I could see that only the tire MeshPart is in touch with the rail.

Captura de pantalla 2024-11-10 154815

It didnt derailed but it became slow and it kept shaking

1 Like

Do you mind sending the files for us to try to mess around with?

2 Likes

Keep a very small gap between the rails/invisible part and the wheels.
If this doesn’t fix your issue, try reducing the rails friction in their physical properties as well.

And don’t use a mesh part for wheels physics, use a part (with a cylinder shape) since it has accurate physics while being more performant.
Idk if that’s already what you’re doing tho.

1 Like

I sent this in a PM to Alex72620_YT. It’s a test/tutorial place I made up and adjusted. It’ll run at about 250 studs per second for long periods without derailing and even has controllable switches for a siding to play with.
Train test, bogies with tilt (VectorForce or Hinges).rbxl (191.8 KB)

1 Like

So yeah, apparently the issue was the excessive amount of hinges that I was using, the fact that I was using a mesh as a wheel and I needed to make a wheel under the rail and a wheel under as well as a vertical wheel between each wheel.

Very special thanks to @Scottifly for helping me with this problem, thanks to him and his model that he published in this post my train can now reach 160 without derailing, it still shakes a little bit when I go upwards, but it doesn’t derail and I’m very thanked for that.

1 Like

Hello, it’s me again. It turns out that the parts that cover the wheels were colliding with the wheels and that was causing the shaking, as soon as I turned those unions collision off the shaking stopped. I also changed the rails that were Unions and changed them for Parts as @Scottifly suggested me from the beginning lol (I’m so sorry Scotti.) I think that the problem I published 9 days ago is now 100% solved, and I can finally start with the next part.

Again, thank you so much for your help @Scottifly, and thank you for being SO PATIENT with me.

P.S: While I was typing this I ran a 2 player test to see how fast does the train look from another perspective and I found this issue where the train shakes a lot from the player that is not driving the train. But I think that I should open a new topic for this.

2 Likes

Yeah, that issue is due to NetworkOwnership.
The player sitting in the seat gets client ownership which then gets sent to the server. That information then gets sent to the person viewing the movement so you’ve got the ping of the client to the server to the other client to deal with.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.