Skip to content

Object.GetMaterial()

YaniL12 edited this page Feb 19, 2021 · 2 revisions

Get's the material (floor or wall type) at the specified location.

Returns a string with the name of the material (as defined in materials.txt).

-- get material that's directly below local object...
local material = Object.GetMaterial( this.Pos.x, this.Pos.y );

if material == "Grass" then
  -- whatever```
end

Materials that Entities can not walk on include:

"Water"
"BuildingConcrete"
"BuildingFrame"
"ConcreteWall"
"BrickWall"
"PerimeterWall"
"Fence"
"BurntWall"
"Roof"
Clone this wiki locally