I’m trying to offset the position by the size based on the rotation of the model, but I dum
local function calcPropPos()
local mouseTarget = getMouseTargetWithWhitelist()
if mouseTarget then
local targetedPart = mouseTarget.Instance
local tempCFrame = CFrame.new(mouseTarget.Position.X, mouseTarget.Position.Y, mouseTarget.Position.Z)
tempCFrame *= placementRotationCFrame
local rotationalOffset = placementRotationCFrame:PointToObjectSpace(Vector3.new(selectedHitbox.Size.X/2, selectedHitbox.Size.Y/2, selectedHitbox.Size.Z/2))
local offset = mouseTarget.Normal * rotationalOffset:Abs()
--if snapping is on
if flags["Placement"][1].snap == true then
tempCFrame = CFrame.new( math.round(tempCFrame.X / snapSize) * snapSize, math.round(tempCFrame.Y / snapSize) * snapSize, math.round(tempCFrame.Z / snapSize) * snapSize) * placementRotationCFrame
end
return tempCFrame + offset
end
end