It doesn’t look like there’s anything wrong with this specific line, so this might be a problem with some other area of your code (maybe this line is never being reached and not running?). It would throw an error if the Model object didn’t have a primary part, or anything obvious like that.
Is the wall you referred to as ‘Object’ actually referred to properly by the script?
Is the wall Anchored? If it’s Unanchored and attached to something else this CFrame script won’t move it.
It’s referred to properly and it’s anchored, it just doesnt seem to work in this scenario:
elseif Input.KeyCode == Enum.KeyCode.R then
if Placing == true then
Object:SetPrimaryPartCFrame(Object:GetPrimaryPartCFrame()*CFrame.Angles(0,math.rad(90),0))
end
But works fine in this:
function Place:Update(hit, Target)
if Placing == true then
local Level = Grid.Position.Y + (Grid.Size.Y / 2) + (Object.PrimaryPart.Size.Y / 2)
local DistFromTL = TopLeft - Vector3.new(Round(hit.p.X), Level, Round(hit.p.Z))
game.Workspace.Placing:FindFirstChildWhichIsA("Model"):SetPrimaryPartCFrame(CFrame.new((TopLeft.X - DistFromTL.X) + ObjectExtents.X / 2, Level, (TopLeft.Z - DistFromTL.Z) + ObjectExtents.Z / 2))
Intersect()
end
end
In the first example you refer to it as: Object:SetPrimaryPartCFrame(Object:GetPrimaryPartCFrame()*CFrame.Angles(0,math.rad(90),0))
but in the second case you refer to it as: game.Workspace.Placing:FindFirstChildWhichIsA(“Model”):SetPrimaryPartCFrame(CFrame.new((TopLeft.X - DistFromTL.X) + ObjectExtents.X / 2, Level, (TopLeft.Z - DistFromTL.Z) + ObjectExtents.Z / 2))