Good as it is in the Title I would like to know if there is any way to detect the Terrain Material that the player is stepping on
The humanoid has a property called FloorMaterial. It works with terrain materials as well.
I just tested and it doesn’t seem to work with all materials
Well, it should, can you show us a video of it not behaving as needed?
@0_1195 's post should work for you. Are you properly listening to the changes made on FloorMaterial?
local Humanoid = route.to.humanoid
Humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
print("New value for FloorMaterial: " .. Humanoid.FloorMaterial)
end)
Yeah as @AbiZinho said! I assume the property doesn’t change on the properties tab but if you print it
print(humanoid.FloorMaterial)
It would print it
This is a little off-topic, but does anyone know how to detect terrain material using a ray?
:FindPartOnRay()
doesn’t actually return just the part that it hit, and the exact location where it hit, it actually returns other values.
It returns the Material of the part that hit as a 4th value.
local _, __, ___, material = workspace:FindPartOnRay(ray)
print(material)
Hey, thanks man! I tested it through the console thingy real quick, but it’s the 4th value, the 3rd one is surface normal :V
Oh yeah sorry my bad I misstyped