Anyway to achieve a "Target Surface Filter"?

Is there any way to achieve a “Target Surface Filter” just like mouse.TargetFilter but for mouse.TargetSurface ? plot twist dun dunnnn very confusing to write
Any help is appreciated!

From what I can tell there isn’t any, though you can use a table and conditional that should do a similar job.

local targetSurfaceFilterTable = {} --Put the surfaces you want to filter out here
local Mouse = game:GetService("Players").LocalPlayer:GetMouse()

local function checkTargetSurface(Surface)
   local filterSurface = false

   for i,v in pairs(targetSurfaceFilterTable) do
       if Surface == v then
           filterSurface = true
       end
   end 

   return filterSurface
end

Say you have 2 blocks, one in the front. Say I’m pointing the mouse at the front block, I want to know the surface of the object in the back as if the mouse is pointing at it as the front block doesnt exist

I just found out RaycastResult.Normal, sorry for wasting your time.

1 Like