Class: Terrain
Lua
C++
Edit

Terrain:GetMaterials

This method gets all the materials in use on the terrain at the specified coordinate.

Syntax

function Terrain:GetMaterials(x, y)

Parameters:

Returns:

Example

local terrain = Terrain.new()
local materials = terrain:GetMaterials(10, 20)

for i, material in ipairs(materials) do
    print("Material "..i..": "..material.name)
end

In this example, the GetMaterials method is called on a Terrain object to retrieve all the materials at the coordinate (10, 20). The result is stored in the materials table, which is then iterated over to print the name of each material.

Copyright © 2024 Ultra Software.
All rights reserved.