SetMeshMaterial

Category: Objects / Display
Since engine version: 1.0 OC

Description

Changes the material of the calling object's mesh at runtime.

Syntax

bool SetMeshMaterial(string material, int submesh);

Parameters

material:
Name of the material to set. It needs to be loaded at engine startup, i.e. it needs to be defined in a *.material file being located in an object that was loaded.
submesh:
[opt] If the mesh is composed of multiple submeshes then this parameter can be used to specify the submesh whose material is to be changed.

Example

SetMeshMaterial("Clonk_Body_EyesClosed");
Schedule("SetMeshMaterial(\"Clonk_Body\")", 5);
Makes a clonk blink.
See also: GetMeshMaterial
Clonk-Karl, 2010-04