I want my train to move forward with physics (no tweening)
The way I am doing it makes it the train flies when the train is pointed into the air.
I need ideas on how I could make the train move.
script.Parent.Velocity = script.Parent.CFrame.lookVector *200
wait(0.1)
end
1 Like
script.Parent.Velocity = 200 * (script.Parent.CFrame.lookVector * Vector3.new(0, 1, 0))
This should work, hope it helps!
EDIT: Make sure you are using run service when dealing with physics.
game:GetService('RunService').Stepped:Connect(function()
script.Parent.Velocity = 200 * (script.Parent.CFrame.lookVector * Vector3.new(0, 1, 0))
end)
1 Like
Oh you also want the orientation. Try this
game:GetService('RunService').Stepped:Connect(function()
script.Parent.Velocity = 200 * (script.Parent.CFrame.lookVector * Vector3.new(0, 1, 0))
script.Parent.Orientation = script.Parent.Orientation * Vector3.new(0, 1, 0)
end)
It still fly in the sky in the sky
Yes, but there isn’t an easy way to prevent this. Just don’t let the train go off the map
1 Like
CentiDev
(Centipede)
#7
He can put an invisible part in front of the train and then ray cast down and if there is nothing then set velocity to 0
DataSigh
(DataSigh)
#8
Idk if it because i’m sleep deprived but that video was the funniest thing i’v seen in a month. Couldn’t stop laughing
7 Likes