I am currently creating a block placement system, However when I hover my block over a base part that is rotated, then the block’s offset will be off as you can see in the video below. This is because Mouse.TargetSurface can be inaccurate if a base part is rotated. I’d like to know if there are any alternatives for Mouse.TargetSurface.
Uploading: 2023-07-27 11-36-56.mp4…
Here is a portion of my script that is used to calculate the blocks offset
-------Block Offsets
if Mouse.TargetSurface == Enum.NormalId.Top then
Block.Position = Block.Position + Vector3.new(0,Offset,0)
elseif Mouse.TargetSurface == Enum.NormalId.Back then
Block.Position = Block.Position + Vector3.new(0,0,Offset)
elseif Mouse.TargetSurface == Enum.NormalId.Right then
Block.Position = Block.Position + Vector3.new(Offset,0,0)
elseif Mouse.TargetSurface == Enum.NormalId.Bottom then
Block.Position = Block.Position - Vector3.new(0,Offset,0)
elseif Mouse.TargetSurface == Enum.NormalId.Front then
Block.Position = Block.Position - Vector3.new(0,0,Offset)
elseif Mouse.TargetSurface == Enum.NormalId.Left then
Block.Position = Block.Position - Vector3.new(Offset,0,0)
end