I'm creating a program where you need to know which side of the part is clicked, to determine the orientation of an object that will be attached to the part. The rest I can take care of, but I'm not sure how to get the exact side of the part (i.e, TopSurface, RightSurface, LeftSurface, etc - but with position).
The code itself should print the side of the part that was clicked with the user's mouse, but I have no idea how I'd go about doing this. Here is how I planned on it looking:
local PlayerService = game:GetService'Players'
local Player = PlayerService.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Button1Down:connect(function()
local Target = Mouse.Target
if Target and Target:IsA("BasePart") then
local MousePos = Mouse.Hit.p
local PartSide -- Where it calculates the side of the part that's clicked
print(PartSide) -- Print the position, string, or anything that represents the side of the part that was clicked.
end
end)
If anyone has any insight on how I could go about solving this, it'd be much appreciated!

2 comments
Wow, looked at the wiki page before and I was completely blind to that. Thank you.
Your Welcome.