I am trying to make an automatic train that moves along tracks and so far I have made it so it can move in one path but I am stuck on making it actually turn freely. Right now I’m CFraming the train to make it move forward and using “fromEulerAnglesXYZ” to turn it but that doesn’t allow it to turn freely. Is there a way to make the train turn freely with Cframe and if not with CFrame, what should I use in order to do that?
Script:
workspace["DC Metro11"].PrimaryPart = script.Parent.Engine
while true do
for i = 1,100 do
wait()
workspace["DC Metro11"]:SetPrimaryPartCFrame(CFrame.new(workspace["DC Metro11"].PrimaryPart.Position + Vector3.new(0,0,-1)) * CFrame.fromEulerAnglesXYZ(0, math.rad(10),0))
end
end