Placement System clipping trough other parts

Hey scripters, ive been looking for a solution to this problem and cant find any. ive looked across the whole internet and cannot find anything about this

here is some pictures of the problem and some pictures of the main lines of code :




Thank you
Justlaterreur999

1 Like

There are a few things I would do differently at just a quick glance at your code. Personally, I would use math.pi / 4 to rotate Additionally, the way you are getting your offset is wrong, you need to get the half size of every single axis so just make that a Vector3, and then using the Dot product.

local halfSize = Vector3.new(
PreviewPart.Size.X / 2,
PreviewPart.Size.Y / 2,
PreviewPart.Size.Z / 2
)
local offset = Raycast.Normal * math.abs(halfSize:Dot(Raycast.Normal))

You also need to round the CFrame first and then apply the offset.

hey @UnscriptedContent, thank you for replying.

ive tried it and still doesnt work, ive messed around with a bit trying changing some stuff and cant get it to work. the placing part now have a new way of positioning his self. it doesnt clip into other part like it used to but its still not what i want do you have more ideas why it doesnt work ?

heres pictures of the script

forgot to send you this peice of code sorry. this is the new rotation that works with math.pi

1 Like