Hello Developers,
I’m going to tell you how to make a basic train, which can move and even turn, here’s a video:
Now you see, the train can actually turn
This is a tutorial on how to make the basic train, which moves, not the train which you see irl
This is an easy tutorial, and it is based on basic scripting and Roblox physics
Step 1: Making the track
You need to make two blocks as a support, then you need to keep some space for moving
Step 2: Decorations
Make sure you make the decorations CanCollide
as false, the train should not be hit by any obstacle, causing it to de-rail
Step 3 : Making train movement system
First make the base of train
Second, keep 2 wedges like in the image
This is for sliding the train and to avoid easy de-rails
Now, weld the wedges to the base, don’t anchor any part of the train
Make sure the base of the train faces the front side of train
Now, to avoid unnecessary orientation
Keep 2 blocks, front and back, and make them transparent, make sure to weld them to train base
Its just a block, make sure it has 1 stud distance from track
Now add a script in the base of the train
Script:
while task.wait(0.1) do -- a loop
script.Parent.AssemblyLinearVelocity = script.Parent.CFrame.LookVector*-15 -- makes the force of the train, 5 studs per second
end
Now test it:
You can add more stuff on train, make sure you give upward force if the train is too heavy, and give more force to the train to move it faster, too fast = de-rail so be careful
Tutorial is done
Enjoy!
Support me
Paypal
$1 raised
Donated People List
$1 Alejandro Herrera