I don't know if it's possible to check what terrain type is touched, but if so, would this be to check?
1 | script.Parent.RightLeg.Touched:connect( function (hit) |
2 | if hit.Material = = Enum.Material.Slate then |
3 | -- stuff |
4 | end |
5 | end ) |
GetCell()
CellMaterial, CellBlock, CellOrientation GetCell ( int x, int y, int z ) Returns the material, type, and orientation of grid cell (x, y, z).
^From the wiki
You could call that method when your character is touching the Terrain, and getting the Cell doing Character.Torso.Position.Y-4 or something.
GetCell() will return the Material of the Cell.
If you're not aiming for game terrain, then this should do:
1 | script.Parent.RightLeg.Touched:connect( function (hit) |
2 | print (script.Parent.Name .. " has touched " .. hit.Material) --Easy fix, just be sure to have the Output window open in studio. (Found in the View tab.) |
3 | end ) |
Hope that helps!