Different walking sounds using material varients?

So i have walkingsounds that align with what your walking on, and theres no real water material so i made a materialvarient but its not really understanding and I dont know much about materialvarients either.

local function getFloorMaterial()
	floorMaterial = humanoid.FloorMaterial
	if floorMaterial.MaterialVarient == "WaterSounds" then
	material = string.split(tostring(floorMaterial), "Enum.Material.")[2].MaterialVarient
	else
		material = string.split(tostring(floorMaterial), "Enum.Material.")[2]

	return material
	end
end
1 Like

MaterialVarient is spelled with an a, not an e.

I don’t think MaterialVariant exists for the Humanoid.FloorMaterial property.

You will likely need to use the MaterialVariant property of the part that the player is currently walking on.

This property is not a part of the Material property (you can’t do Material.MaterialVariant) so instead, could try to use a RayCast going towards the ground from the character’s HumanoidRootPart and getting the MaterialVariant property of the part below the character.