ReplaceMaterial replaces terrain of a certain
enum/Material within a
datatype/Region3 with another material. Essentially, it is a find-and-replace operation on
When calling this method, the
resolution parameter must be exactly 4. Additionally, the Region3 must be aligned to the terrain materials grid, i.e. the components of the Region3’s minimum and maximum points must be divisible by 4. Use
Region3:ExpandToGrid to make a region compatible with this function.
The region in which the replacement operation will occur
The resolution at which the replacement operation will take place; at the moment this must be exactly 4.
The old material that shall be replaced
The new material
This code sample demonstrates the usage of
Terrain/ReplaceMaterial by replacing grass near the game origin with asphalt. It does this by constructing a
datatype/Region3 using two