Need help with part side detection for building system

Hello!
I am trying to figure out how to detect which side of a part is another part using, I need this for a building script of mine (Started as a free model but I decided to rewrite it.)
If you guys could help me figure out a way to detect, that would be awesome!
(P.S this current code works but I can’t get the side of which to place the block on.)

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Target = true
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local GrassPlace = ReplicatedStorage:WaitForChild("Grass")

Mouse.Move:Connect(function()
	game.Workspace.DoNotMove.Select.Highlight.Position = Vector3.new(Mouse.Target.Position.X, Mouse.Target.Position.Y, Mouse.Target.Position.Z)
end)



Mouse.Button1Down:Connect(function()
	local newBlock = GrassPlace:Clone()
	newBlock.CanCollide = true
	newBlock.Position = Vector3.new(Mouse.Target.Position.X, Mouse.Target.Position.Y, Mouse.Target.Position.Z)
	newBlock.Parent = workspace
end)
1 Like

You’ll probably have better luck with Surface Normals

Lemme check these out more. I thought they might not work but I think it might.

So how would I reference it in my code, like get it in my case where I need to get the surface normal of the mouse.hit/target.