I’m creating foliage generation for my game; however, I’ve run into an issue where it spawns the wrong asset when selecting the biome type.
Furthermore, inside the biome table, I have only the bottom item inside the table that will spawn the right assets.
Here is part of my script
local biome_sets = { -- these are the asset sets I pick
Flats = FoliageAssets:WaitForChild("DefaultBiome"):GetChildren(),
Basalts = FoliageAssets:WaitForChild("Sands"):GetChildren(),
}
local biome_list = { -- these are the biomes I use to detect the material, the first one is default
{nil,biome_sets.Flats},
{Enum.Material.Sandstone,biome_sets.Basalts}, -- doesn't work...
{Enum.Material.Grass,biome_sets.Basalts}, -- works
}
local BiomeGrowth
for i,v in pairs(biome_list) do
if v[1] == ray.Material then
print(ray.Material)
BiomeGrowth = biome_list[i][2] -- picks the "biomes" specific assets.
else
warn(ray.Material)
BiomeGrowth = biome_list[1][2] -- picks the default biome assets, "aka grass"
end
end
local random_asset = BiomeGrowth[math.random(1,#BiomeGrowth)]:Clone() -- this replicates the asset
Here is a pick of that bottom item in the table clearly working.
And here is that same generation but with sandstone, “which is the middle item in the table” not working.
So, tell me if I’m missing anything or if you need more information. Thanks!

