I am currently making a plot-building system and I want to be able to place parts on the side of others. With my old script, whenever I clicked on a wall, the part I want to place would stick half of itself in the wall since I set its position to the mouse’s position.
I had another idea to put attachments on all sides of the part and use one of them as a reference point by detecting which surface (front, back, left, right,…) of the wall my mouse is on.
Eg:
The problem with this method is that if the wall or the part is rotated, the surface does not face the same way. This is because I am using a mouse.TargetSurface.Value to have the side of the wall that my mouse is pointing at and then use one of the attachments as the parts pivot point.
Anyone would have another idea or method to offset a part on any surface so it sticks on a wall rather than clipping through it?