Not sure if this is possible, as there aren’t any properties of a model that TweenService could use I believe.
Any ideas? Just curious, as using TweenService would create a smoother effect than using something like lerping.
Thanks
Not sure if this is possible, as there aren’t any properties of a model that TweenService could use I believe.
Any ideas? Just curious, as using TweenService would create a smoother effect than using something like lerping.
Thanks
A quick tip: I do not advise using SetPrimaryPartCFrame. In fact, I highly advise AGAINST using it. It can cause parts to slowly drift apart due to floating point errors.
I’d recommend rewriting this to weld the parts together and tween the CFrame of the primary part directly, although if you really need something to work right now, this will suffice.
local CFObject = Instance.New("CFrameValue") -- Placeholder value
local DesiredCF = CFrame.new(0,5,0) -- Your desired CFrame
Model = game.Workspace.Model -- Your desired model
local Tween = game:GetService("TweenService"):Create(CFObject, TweenInfo.new(5), {Value = DesiredCF}) -- Create the tween
local Con = game.RenderStepped.Stepped:connect(function())
Model:SetPrimaryPartCFrame(CFObject.Value) -- Sync the model's position to the tweening Value
end
Tween:Play()
Tween.Completed:Wait()
Con:Disconnect()
Like I said, I’d highly suggest writing your own method to weld the model together then tween the primarypart’s cframe directly, but this will suffice until then.
Dang, I never knew that about that method.
However, this is puzzling because the whole model needs to be anchored, so welding wouldn’t work in that case?
If you anchor the PrimaryPart, leave every other part Unanchored, and then weld them together, it simulates everything being anchored while still moving codependantly of the PrimaryPart.
I’ll try this right now. Thanks!