How to Replace a certain material type from terrain in an area using a script

There’s an API function for that called ReplaceMaterial, however, using this will also put water below the sand. If that’s a problem, you will probably need to use ReadVoxels and WriteVoxels.
Terrain:ReplaceMaterial()

1 Like