Problems with train wheels and movement

What am I attempting to achieve?
I want to make a train system that the player will be able to drive and it must handle a train-vehicle collision properly. Additionally, I would like the train to decelerate slowly. My current version of the train can stop nearly instantly, which is not what I am looking for.

What is the issue?
My current system works with a torque of 10000, but it derailed easily when a vehicle was within its path because the train was too light. When I added more weight, but increased torque, the wheels became very unstable. The wheels will jump away from the train, leaving a gap between the wheel’s base and the train, causing a derailment.

What solutions have I tried so far?
I’ve tried placing a part below the train between the rails so that it couldn’t derail, but this doesn’t work because the train is propelled by the wheels on the track, so while it wouldn’t derail, it would slow down or stop. Additionally, the tracks feature level crossings, preventing any parts from being placed between the rails except for a small part on the inside of each rail. I’ve also tried adjusting the physical properties of the wheels and the train to help keep it on the rail, but all attempts resulting in either the train being too slow and/or the wheels jumping off the tracks. The only solution that’s worked is lowering the weight of the train and lowering the cylindrical restraints torque, but that makes the train too light, and it derails easily when a vehicle is in its path. Finally, I looked in the DevForum for advice but found none that was relevant to this specific design.

This is a picture of the design of the wheels, so you can better understand the issue.

If you want to get the model so you can troubleshoot it, I’ve included a line below. I appreciate any help you give.

Are you using Mesh or Union wheels? They are not round and will not rotate smoothly. You’re best to use transparent Cylinder Parts and weld them to the CanCollide off wheels you have.
As far as moving the train more realistically (accelerating and decelerating) you may be better off scripting BodyMovers to do that so you can control the speed better.

Actually, those wheels are neither meshes nor unions. I’m using two cylinders welded together as a wheel. However, I will look into possibly using BodyMovers.

What if you put a CylinderMesh into the large part of the Wheel, so that it appears that size but is actually a bit larger and will catch the rail inside edge a little better?

Actually, while I was working on this, I discovered a larger issue. In the original design, the base of the train collided slightly with the wheels, which then required a much higher amount of torque in order to move. This lead to ridiculous levels of torque being needed in order to move the train, and probably also caused the instability. There’s still some problems with instability, but this seems to have mostly fixed it.

1 Like