Category: Landscape / Material
Since engine version: 7.0 OC
Determines the background material type at the specified position in the landscape. Returns a material index which can be used for comparison e.g. with Material. For sky background the function returns -1. The background material is the material that a pixel is replaced with when it is digged away or blasted free.
int GetBackMaterial(int x, int y);
- X coordinate at which to check the background material. Offset in local calls.
- Y coordinate at which to check the background material. Offset in local calls.
This functions only processes static materials - moving material pixels such as rain or snow are not evaluated.
if(GetMaterial(0, 0) == Material("Water") && GetBackMaterial(0, 0) == Material("Water")) Message("I am in a neverending stream of water!");
Part of a clonk script: if the clonk is swimming in water that is replaced with water when it flows away, a message is displayed.