I am trying to make a train system for my upcoming game I saw a lot of tutoriol of how to move stuff I know that you can use Body mover , tween , lerp , cframe , to move stuff but I Don’t which one is the best and jailbreak train system is the perfect system iam looking for but I Don’t know what they use to move it?
It’s an automatic train not drivable.
2 Likes
I will try it out later 30 characters
They use CFrame to move it.
I have this train someone made for me. I’m trying to make it follow these railroad tracks that curve. How would I make it follow the path along with the train cars?
I can’t think of anyway to move it in a path.
[RobloxScreenShot20190602_183918636]
There are also quite a bit of topics on the devforum on this:
https://devforum.roblox.com/search?q=How%20to%20make%20a%20train
To add on to what I just said, You will also need to move the player with the train, and to do this you could also look at these two topics:
So I found a fix for this, what you need to do is use the following code instead:
local Players = game:GetService("Players")
local player = game.Players.LocalPlayer
local RunService = game:GetService('RunService')
local LastHit
local LastTrainCFrame
local Function
local Function2
Function = RunService.Heartbeat:Connect(function()
local RootPart = player.Character.HumanoidRootPart
local Ignore = player.Character
local ray = Ray.new(RootPart.CFrame.p, Vector3.new(0,-500,0))
local Hit, Po…
OK, I found the issue and rewrote the basic code you posted with a fix and some of the stuff I previously said.
-- Localscript inside of StarterCharacterScripts
local Players = game:GetService("Players")
local player = game.Players.LocalPlayer
local RunService = game:GetService('RunService')
local LastHit
local LastTrainCFrame
local Function
local Function2
local Whitelist = {workspace.Trains}
Function = RunService.Heartbeat:Connect(function()
local RootPart = player.Character.HumanoidRoo…