local Ship = script.Parent local Nodes = workspace.ShipNodes local ShipNodes = workspace.ShipNodes:GetChildren() local tweenService = game:GetService("TweenService") local info = TweenInfo.new() local function tweenModel(model, CF) local CFrameValue = Instance.new("CFrameValue") CFrameValue.Value = model:GetPrimaryPartCFrame() CFrameValue:GetPropertyChangedSignal("Value"):Connect(function() model:SetPrimaryPartCFrame(CFrameValue.Value) end) local tween = tweenService:Create(CFrameValue.Value, info, {Value = CF}) tween:Play() tween.Completed:Connect(function() CFrameValue:Destroy() end) end while wait() do for i = 1, #ShipNodes do tweenModel(Ship, Nodes:FindFirstChild("Node" .. i)) wait() end end
**** 22:36:59.450 - TweenService:Create property named 'Value' cannot be tweened due to type mismatch (property is a 'CoordinateFrame', but given type is 'Instance') 22:36:59.451 - Stack Begin 22:36:59.452 - Script 'Workspace.Ship.Script', Line 17 - local tweenModel 22:36:59.452 - Script 'Workspace.Ship.Script', Line 28 22:36:59.452 - Stack End****
Looks like you cannot tween a CFrameValue, you can use a part in nil and then CFrame it, then make the model follow it
local Ship = script.Parent local Nodes = workspace.ShipNodes local ShipNodes = workspace.ShipNodes:GetChildren() local tweenService = game:GetService("TweenService") local infoArray = { 1, --// Duration of the tween Enum.EasingStyle.Style, --// style Enum.EasingDirection.In, --// Easing Direction false, 0, false } --// Info local info = TweenInfo.new(unpack(infoArray)) local function tweenModel(model, CF) local Part = Instance.new("Part") Part.CFrame = model:GetPrimaryPartCFrame() Part:GetPropertyChangedSignal("CFrame"):Connect(function() model:SetPrimaryPartCFrame(Part.CFrame) end) local tween = tweenService:Create(Part, info, {CFrame = CF}) tween:Play() tween.Completed:Connect(function() Part:Destroy() end) end while wait() do for i = 1, #ShipNodes do tweenModel(Ship, Nodes:FindFirstChild("Node" .. i)) wait() end end
What we basically do is make a part and Tween it, and listen for every time its CFrame changes, so the model follows it.
If this answered your question mark it as the answer!