When I’m trying to move with a tweenservice a model (welded) it doesn’t work:
local tweenservice = game:GetService("TweenService")
local primary = script.Parent.Parent.Parent.chest
local tweeninfo = TweenInfo.new(3)
local target = {CFrame = primary.CFrame + Vector3.new(0,0.907,0)}
local tween = tweenservice:Create(primary,tweeninfo,target)
tween:Play()
The error is: CFrame is not a valid member of Model "Workspace.Oil.Base.number1.chest"
Models don’t have CFrame properties, if you want to move a model, you’d have to use :MoveTo() or :PivotTo(), or you could set a PrimaryPart, weld everything to that part, unanchor everything except that part, then tween the part somewhere.
To move a model you have to use model:PivotTo(), and you can’t tween the model itself like that. To tween a model you would have to set its PrimaryPart to one of the parts within the model, make sure all the other parts are not anchored and welded to the primary part, then you can tween model.PrimaryPart’s CFrame and it should move the entire model. The other way would be to not use TweenService and instead lerp the model which is a little more complicated:
local run = game:GetService("RunService")
local cumulative = 0
local final = 5 --how long in seconds it will take
local startpoint = model:GetPivot()
local endpoint = --cframe of where you want it to move
while cumulative < final do
cumulative += run.Heartbeat:Wait()
model:PivotTo(startpoint:Lerp(endpoint,cumulative/final))
end