Unable to assign MaterialVariant via script

Title says it all, I have a MaterialVariant named “Slime” located in MaterialService.
Whenever I try to make a new part with the variant via script, I just get a warning saying “Unable to find a MaterialVariant matching the name.”

local part = Instance.new("Part")
part.MaterialVariant = "Slime"
part.Parent = workspace

Are you 100% there’s a MaterialVariant object inside of MaterialService named Slime? I’ve tested this out and it works perfectly for me, try to assign the Material first, the material is supposed to be the same one you assigned inside the material variant, for example in my test I used Ice:
Using this code in command bar:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.