Here's the code I did (it's in a LocalScript in StarterPlayerScripts):
while wait(1) do
local p = game.Players.LocalPlayer
local m = p:GetMouse()
if m.Target.Name == "Terrain" then
print(m.Target) -- Here is where I want something like m.Target.TerrianMaterial
else
print(m.Target)
end
end
I want it to print "Stone" or "Mud" if the mouse target is pointing to "Stone" or "Mud" (just an example).
Is this possible?

4 comments
Cast a ray at m.Hit and check the material it returns
as far as i can tell this is the best way to do this ^
ok
I'd cast a ray at m.Hit and check the mater u want return it