I’m trying to make my helicopter tween upwards towards a node but the tween does not work.
Everything is welded but the tween does nothing.
function followNodes(rootNode)
local nodes = rootNode:GetChildren()
local heliRoot = helicopterMain.PrimaryPart
local fly = tween:Create(helicopterMain.PrimaryPart, TweenInfo.new(3), {CFrame = heliRoot.CFrame * nodes[1].CFrame})
fly:Play()
end
The source code for the helicopter tween, help will be appreciated.
I wouldn’t really use welds, just anchor the entire model, and set a primary part.
The following code should work:
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, info, {Value = CF})
tween:Play()
tween.Completed:connect(function()
CFrameValue:Destroy()
end)
end
(Not mine I have no idea who originally come up with this, but I use it a LOT)