Rotated PrimaryPart doesn't rotate other parts of the model

I’m trying to make it so that a part is cloned from ReplicatedStorage and has it’s PrimaryPart rotated such that it is identical to the Orientation of another PrimaryPart in the game.

local floor = workspace:FindFirstChild("Floor").PrimaryPart
local clone = game:GetService("ReplicatedStorage"):FindFirstChild("Wall")
clone.PrimaryPart = clone:FindFirstChild("Base")
clone:SetPrimaryPartCFrame(CFrame.new(floor.Position))
clone.PrimaryPart.Orientation = Vector3.new(floor.Orientation.X, floor.Orientation.Y, floor.Orientation.Z)
clone.Parent = workspace

At the moment the model will indeed be placed into position but only the PrimaryPart itself has it’s Orientation changed to match. It was my understanding that the whole model is supposed to follow suit?
If this is not the case I suppose I could run a loop through all the descendants of the model but surely there must be another way to go about it?

1 Like

iirc you can’t set the orientation of a part. What you could do instead is simply set the entire CFrame of the clone to be the same as the CFrame of the original part.

That’s confusing because the PrimaryPart did end up having it’s orientation changed, just not the rest of the model it was a member of.

Wouldn’t that run into the same problem I mentioned above? Since I’m working with 2 models, as far as I’m aware, I need to be rotating the PrimaryPart.

Try

clone:SetPrimaryPartCFrame(floor.CFrame)

instead of

clone:SetPrimaryPartCFrame(CFrame.new(floor.Position))
clone.PrimaryPart.Orientation = Vector3.new(floor.Orientation.X, floor.Orientation.Y, floor.Orientation.Z)

3 Likes