So I’m working for my friend’s game, and I’m trying to create a winter theme for the map. I’m bascially just trying to change all parts/meshparts/unions that have the grass material change their colour and material.
Here is the script.
for _,v in pairs(workspace:GetDescendants()) do
if (v:IsA'MeshPart') or (v:IsA'Union') or (v:IsA'Part') then
if (v.Material == Enum.Material.Grass) or (v.Parent.Name == 'Path') then
pcall(function()
v.UsePartColor = true;
end);
v.Material = Enum.Material.Snow;
v.BrickColor = BrickColor.new'Institutional white';
end;
end;
end;
My problem is that the script works completely fine for parts and meshparts, but doesn’t work for unions even though they all have UsePartColor enabled. I see absolutely no errors in the developer console, and I currently have no idea what the solution to this is. I can edit the colour and material manually in edit mode.
Edit Mode:
When Ran:
(Unions are not affected by the script when parts and meshparts are)

