Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Primary part tweens by itself instead of the whole model?

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







1 comment

0

You have to use :SetPrimaryPartCFrame()

1 answer

✓ Accepted answer

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)

1 comment

0

Thanks for your time!

This discussion is preserved as it was. New answers, comments, and votes are closed.