I’m creating a placement system but I do not know how to add rotation for wall objects, basically, the rotation that player can add with “R” just makes the model go inside the wall object
Using this I got something decent but doesn’t work on rotated parts
local relativeVector = target.CFrame:VectorToObjectSpace(normal)
relativeVector = model.PrimaryPart.CFrame:VectorToObjectSpace(relativeVector)
I use this to calculate the size
local function getModelSize()
local primary = model.PrimaryPart:Clone()
primary.Name = "fake_primarypart"
primary.Transparency = 1
primary.Parent = model
local primaryPartCFrame = model:GetPrimaryPartCFrame()
primary.CFrame = CFrame.new(primaryPartCFrame.Position)
local _, size = model:GetBoundingBox()
--size = model.PrimaryPart.CFrame:VectorToObjectSpace(size)
primary:Destroy()
return size
end
If you need more info just ask in the replies section.