local TweenService = game:GetService("TweenService")
local CFrameValue = Instance.new("CFrameValue")
CFrameValue.Value = Train:GetPrimaryPartCFrame()
local tween = TweenService:CreateTween(CFrameValue, TweenInfo.new(10, Enum.EasingStyle.Linear), {Value = endCFrame}) -- make sure to define endCFrame
CFrameValue.Changed:Connect(function()
Train:SetPrimaryPartCFrame(CFrameValue.Value)
end)
tween:Play()
tween.Completed:Wait()
CFrameValue:Destroy() -- does garbage collection for changed on destroy
If you don’t feel comfortable using this method, then you can use the more updated version of @PostApproval’s model tweening method:
It is so complicated, my mind is hurt while reading this, I will see if I understand how it work when I get back on to the studio later. Thank you for your help.
1- Go to the properties of the model of your train.
2- Click on PrimaryPart, if it has already then leave it like that.
3- Go to explorer and click a part, to select the primarypart, i recommend you the front part.
You can actually move and rotate a model using CFrame even if there are WeldConstraints in its parts. An alternative way to SetPrimaryPartCFrame would be to directly change the CFrame of a random part of the model, which would have to be anchored and welded to the other parts (welding is not disabled).
Yes, that will work. However, using normal welds will in fact break it.
I completely forgot about weld constraints, and I should’ve remembered to tell him to anchor it. All of this stuff should work if this is the case.
As a sidenote, I typically don’t use WeldConstraints, because I’m used to using the typical Welds. I’m also worried that it won’t break joints when an explosion hits it like a normal weld.