Welding Train to rails

Hello, so I am making a train. I have it driving and everything, but the problem is that it doesn’t follow the rails.

I’ve seen posts here about the minecart, but that is done via tweening.

For this thing I had idea to weld it to the rails, but I don’t really know how to do it efficiently.

Here is brief view of what is happening;
https://gyazo.com/bb98484a59fa5d49d13d4666c5937151

Thank you for helping.

3 Likes

If you weld it to the rails it will be stuck in place and not be able to move

I asked somewhere and they said that I should have 4 balls welded to rails

Is that all they said?

They sent picture as well.

image

1 Like

I’m honestly not sure what they were going for there

1 Like

Try moving the rails a little above,and make an sort of part,that doesnt let the train fall.

1 Like

It looks like what they’re suggesting is that you put a ball above each rail and a ball along the inside of each rail and then weld or somehow connect those balls to the train. The two balls on top act as wheels that ride along the tracks and the two inner balls act as guides to keep the train centered over the tracks.

Also, just to clarify. Welding your train to the rails themselves doesn’t sound like a good idea because it would prevent the train from actually moving.

3 Likes

Yes, if you weld two and two together, they will either not move or move together, depending on if they are both designed to move. Also, in your image, I think they were trying to tell you to weld the balls to the carriage itself.

My suggestion is to make an InvisiblePart and weld the train to it. Lift the train up from the track, pixel by pixel and script something to get the InvisiblePart to follow the tracks. In simple, you could also do that for just the carriage itself, but you do what you want.

1 Like

I think it would be probably to copy the rotation of the rail parts using Cframe and move it forwards.

1 Like

Try getting the concept that the owners of those trains game used,to make the trains “welded” to the rails.

1 Like

Thanks everyone for helping, I solved it out a bit, but I have to switch the kits, since the one I have now is not good.

How I made it was that I’ve put spheres like in the picture welded them to the train (sorry for making confusion). And then it would kind of work.

1 Like

If you are using physics like in the real world then you need 2 spheres to roll on top of the track and 2 spheres to run inside the track. The 2 inside shouldn’t touch the wood… they bump against the track and keep the car from tipping over. They should all be welded to a single part under the car. The track is welded by itself.

1 Like

I meant physics of the game vs. using a different method to move the train. In other words something simple like activating a drive seat and then letting the track physically collide with the spheres. I know real trains don’t use multiple spheres :grinning:

The ball method his friend drew him is correct for this case.

Btw… the real world example and 4 ball example are doing the same function. The inside part helps keep the car on the track.

2 Likes

There is a ton of posts that are somewhat similar to this one. I think you could find these helpful, because “welding” a train to a “rail” would most probably cause more issues than solutions if found.

Using different methods for these issues honestly would be your best bet.

2 Likes

you need gliders, little balls that are welded to the train, and allow the train to follow the tracks

1 Like

I suggest that you CFrame trains. Use nodes to make the train follow where its going. This youtube video should help solve the problem: https://www.youtube.com/watch?v=OQtiCt7jma4

It will be long but its worth it.

This may work if you’re using only a few short trains with no controls, but this will quickly become unscalable if you want to have users controlling their own trains.

3 Likes