How would I spawn something on terrain randomly?

I know I could do this with a normal part but with terrain its kinda tricky though, so if you have the knowledge then id be greatly appreciated if you shared!

terrains are represented as voxels so ig you can get the mesh data then move it up correspondent to that

how do i get the mesh data though

Terrain:ReadVoxels() Terrain Editor | Documentation - Roblox Creator Hub

1 Like

For the second parameter though I need a region3 I dont want to make one though

local function printRegion(terrain, region)
    local materials, occupancies = terrain:ReadVoxels(region, 4)
 
    local size = materials.Size -- Same as occupancies.Size
 
    for x = 1, size.X, 1 do
        for y = 1, size.Y, 1 do
            for z = 1, size.Z, 1 do
                print(("(%2i, %2i, %2i): %.2f %s"):format(x, y, z, occupancies[x][y][z], materials[x][y][z].Name))
            end
        end
    end
end

how is the computer suppsoe to know then?

So I want that snow biome to be a certain region so I just make a region then?
If make a region theres no point in even using any terrain functions

I suppose you can check if the voxels material is snow