As a Roblox developer, it is currently too hard to to determine what MaterialVariant a user is walking on. As can be seen below, I am walking on a custom material named, “WetBrick_Large”, but FloorMaterial only returns what the base material is – plastic. This forces developers to create their own custom system to account for this oversight and hinders workflow in situations where this scenario becomes essential. To exemplify, and in my case, this would be advantageous when scripting sounds based on the floor material. As a broader example, any usage of FloorMaterial is currently limited by the total number of default materials, which can be restrictive to developers that need to go beyond that. By addressing this, developers would not be forced to account for this oversight.
Floor BasePart:
Humanoid:
Although including MaterialVariants in FloorMaterial or adding a FloorMaterialVariant property would be massively beneficial, I believe it would be more encompassing to simply have a property or method that returns the part that a user is standing on, as that has a broader use-case. I am not aware of any property or method that returns the actual BasePart the user is walking on. If this already exists, please inform me in a reply or otherwise.
Feature requests are for highlighting our troubles and requests while developing on Roblox in hopes that R&D might understand our use cases for the feature, be it for convenience or because we can’t reasonably or comfortably accomplish that ourselves without native support. It doesn’t have to be “necessary” or “priority” to warrant a writeup.
FloorMaterial itself is determined by an internal Humanoid raycast so it would be trivial to implement by the developer, however it also doesn’t make much sense that we should be forced to reinvent the wheel here. FloorMaterial should support both base materials and MaterialVariants such that the latter, if set, appears instead, for a more accurate representation of the material being stood on.
If knowing both the base material and variant are important, an accompanying property would be able to support both use cases where a developer may need to simultaneously execute logic based on the variant the humanoid is checking on but also the base material. It’s an idea to get behind for sure.
I don’t think a feature request should be dismissed on the basis that there are more important things to add. Roblox has internal processes for triaging feature requests which include prioritisation. Leave that kind of thinking to the people responsible for receiving and addressing our feature requests; developers should be focused on their own problems and use cases for new features, no matter how large or small they might be.
why not add a seperate property for that named FloorMaterialVariant? some developers rely on the FloorMaterial property for Enum.Material, so changing this would purposefully break some games
I agree, which is why I conclude with recommending a property that returns the actual part that the user is standing on. That would offer far more versatility, while also preventing any issues with current code.