Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Primary part tweens by itself instead of the whole model?

Asked by 4 years ago

It seems that when I tween the primary part of the model, it doesn't move the entire model.

local TweenInfo = TweenInfo.new(
    Time,
    Enum.EasingStyle.Linear,
    Enum.EasingDirection.Out, 
    0,
    false,
    0 
)

local Tween = game:GetService("TweenService"):Create(Plane.PrimaryPart, TweenInfo, {CFrame = NewPoint.CFrame})


Tween:Play()

wait(Time)

Tween:Cancel()

print("Tween Successful")



end







0
You have to use :SetPrimaryPartCFrame() Rinextel 291 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

Like that it's working.

local CFrameValue = Instance.new('CFrameValue')
local TweenInfo = TweenInfo.new(
    Time,
    Enum.EasingStyle.Linear,
    Enum.EasingDirection.Out, 
    0,
    false,
    0 
)

CFrameValue.Value = Plane:GetPrimaryPartCFrame()

CFrameValue:GetPropertyChangedSignal('Value'):Connect(function()
    Plane:SetPrimaryPartCFrame(CFrameValue.Value)
end)

local Tween = game:GetService("TweenService"):Create(CFrameValue, TweenInfo, {Value = NewPoint.CFrame})
Tween:Play()

Tween.Completed:Connect(function()
    print('Successful')
end)
0
Thanks for your time! Narrowlegobricks 12 — 4y
Ad

Answer this question