How come my train keeps on bouncing?

I want my train to run smoothly but there is some noticeable bouncing with the train.
Sometimes it even causes the train to jump the track.
I have tried increasing the workspace gravity and decreasing the body velocity force that moves the train with little effect.
Decreasing the body velocity has reduced the bounces but then the bounces can slow down the train.

2 Likes

Ah yes I remember when jailbreak first released the trian robbery it had the exact same problem. Soon after they fixed it and now it runs smoothly. I am not a jailbreak developer, so im not sure exactly how they did this. Luckly I found a post that was talking about this and someone gave a solution. I am not sure if this script will work for you, but its work a shot. Here it is:

local Players = game:GetService("Players")
local player = game.Players.LocalPlayer
local RunService = game:GetService('RunService')

local LastTrainCFrame

local Function
local Function2


Function = RunService.Heartbeat:Connect(function()

--------------------------------------------------------------- CHECK PLATFORM BELOW

local RootPart = player.Character.LowerTorso

local Ignore = player.Character

local ray = Ray.new(RootPart.CFrame.p,Vector3.new(0,-50,0))

local Hit, Position, Normal, Material = workspace:FindPartOnRay(ray,Ignore)

if Hit and Hit.Name == "RaftTop" then -- Change "RaftTop" to whatever the moving part's name is

--------------------------------------------------------------- MOVE PLAYER TO NEW POSITON FROM OLD POSITION

local Train = Hit
if LastTrainCFrame == nil then -- If no LastTrainCFrame exists, make one!
	LastTrainCFrame = Train.CFrame -- This is updated later.
end
local TrainCF = Train.CFrame 

local Rel = TrainCF * LastTrainCFrame:inverse()

LastTrainCFrame = Train.CFrame -- Updated here.

RootPart.CFrame = Rel * RootPart.CFrame -- Set the player's CFrame
--print("set")

else
LastTrainCFrame = nil -- Clear the value when the player gets off.

end

Function2 = player.Character.Humanoid.Died:Connect(function()
	Function:Disconnect() -- Stop memory leaks
	Function2:Disconnect() -- Stop memory leaks
end)

end)
3 Likes

it has not worked for me but I dont realy know where the script is supposed to go.

ohh I found the problem man. You have to change the part that says raftop in quotation mark and change it to whatever you train is named. and also you can put this in a regular script in the server script service. also there are some other things pointed out in the script that you might need to change but i dont understand them. maybe if a scripter comes across this they can help.

1 Like

I think this is for actually making the player stay on the train so they dont fall off
It changes the cframe of the player to the train

1 Like

what exactly happened when you put in the script? did it change anything?

not realy anything
and its supposed to go in a local script because it used the local player
it just errors if its in a server script

ohh ok then did you try local script i really wanna see how it works because this script is supposed to be really good for moving objects ive seen a video on it

For me it does not work it causes my train to shake alot and sometimes sends it up to speeds over 2000 studs per second

it gets rid of the bouncing but makes the train act very crazy

can you send me a picture of the train

robloxapp-20200702-1111059.wmv (2.8 MB)

is there a way to make this script only change the y axis of the train? so it wont shake alot?

What are you using to keep the train on the tracks?
Union wheels, fake transparent wheels, or any sort of wheels at all?
Unions are horrible since when they look round they aren’t. You can go to the Studio Settings>Physics and click the ShowDecompositionGeometry box then change a Property of the Union (I usually just slide the Transparency scale back and forth) to get the change to happen. Another helpful tool is the ShowDecompositionGeometry plugin which allows you to select/deselect the Union with a couple clicks.
If you aren’t using Unions are you using true Cylinders or are sections of the Cylinders bumping into other parts of the bogies causing the bouncing?
Many designers of trains or roller coasters use wheels underneath the tracks to keep the bogies on the rails.
Something else, how are your rail sections built? Do they have large angles between each curved section that cause the bouncing?

1 Like

im using blocks above the rails instead of the actual wheels
and in between the track im using spheres

i have added a body force pushing down and that has seemed to have helped

oh thats pretty good. it looks like its moving well, but are you making it go faster or does it do that itself?

If you want to reduce the elasticity on parts you can enable CustomPhysicalProperties in the parts properties and setting the elasticity and elasticity weight to 0. I recommend doing this for the wheels on the train and the train rails.

i have but, it seems to have caused the problem to get worst

it does that all itself not me

Ok ive did some testing and ive figured it out myself from your responses that i should use a glider under the track and use custom physical properties with the gliders

It gets rid of derailing and the visible bouncing

1 Like

Can you a picture of how the glider looks and the settings you used? I have the same problem thanks

1 Like