So I was testing the Tweenservice method of making doors and trying to see if I can move a train Model with a similar script. The Root Part of the train is moving but the rest is not and welding everything to the root part just stops everything from moving. I know this isn't the best method but I at least had hope as I can't find out how to lerp a model to a coordinate.
Any suggestions welcome and thanks in advance :)
local TweenService = game:GetService("TweenService")
local RootPart = script.Parent.Train:WaitForChild("ROOT PART")
local tweeningInformation = TweenInfo.new(
50,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local RootPartStartStation = {CFrame = CFrame.new(2333.39, 54.267, -50.933)}
local RootPartParkStation = {CFrame = CFrame.new(-144.987, 54.267, -50.933)}
local RootPartEndStation = {CFrame = CFrame.new(-1410.745, 54.267, -50.933)}
local tweenStartStation = TweenService:Create(RootPart, tweeningInformation,RootPartStartStation)
local tweenParkStation = TweenService:Create(RootPart, tweeningInformation,RootPartParkStation)
local tweenEndStation = TweenService:Create(RootPart, tweeningInformation,RootPartEndStation)
script.Parent.Parent.Parent.Detector.Touched:Connect(function(hit)
tweenParkStation:Play()
end)
