Why isn't air being changed to the specified material?

Hey there, I have a plugin I recently made called Terrain Converter. I am trying to add a grow tool option, however, I am unable to override air voxels?

Here is my code:

			elseif mode == 'grow' then
				if materials[x][y][z] == materialsDictionary[mat1.Value] or materials[x][y][z] == Enum.Material.Air then
					materials[x][y][z] = materialsDictionary[mat2.Value]
				end 
			end

This doesn’t override air voxels even though I am allowing it too. Is there something special I have to do for air voxels?

2 Likes

You will also need to set voxel occupancy. You are currently only setting material, not how much of the voxel is occupied by that material.

See read/writeVoxels

1 Like

Thank you!