How do you move a model via PrimaryPart?

Hello.
Can someone please help me with moving a model with it’s primary part?
In this code:

local r = script.Parent.RemoteEvent
local function Launch()
	local carrier = workspace.RedShips.RCV
	local t = carrier.FighterTakeOff
	local f = game:GetService("ReplicatedStorage").RedFighter
	local fighter = f:Clone()
	fighter.TIMER.Disabled = false
	fighter.PrimaryPart.Position = t.Position
	fighter.PrimaryPart.Orientation = t.Orientation
	fighter.Parent = workspace.RedPlanes
end
r.OnServerEvent:Connect(Launch)


The plane isn’t getting moved nor is it’s orientation getting changed

1 Like

All you need to do is:

model:SetPrimaryPartCFrame(CFrame)

To do it smoothly you can keep this
Also this should automatically take care of the rotation

4 Likes

@domboss37 THANKS SO MUCH IT WORKED THX FOR REPLYING SO FAST TSYMMMMM

1 Like

As a heads up, Model:SetPrimaryPartCFrame() has been superseded by Model:PivotTo(), which is essentially the same but with additional functionality and less unexpected behavior.

Although you can continue using :SetPrimaryPartCFrame, it’s recommended to use :PivotTo for new work:

2 Likes