Entity/SetSubMaterial

From Garry's Mod
Jump to: navigation, search
 Entity:SetSubMaterial( )

Description

Overrides a single material on the model of this entity.

To set a Lua material created with CreateMaterial, just prepend a "!" to the material name.

BUG

The server's value takes priority on the client.

Issue Tracker: #3362

Arguments

number index=nil

Index of the material to override, acceptable values are from 0 to 31.

Indexes are by Entity:GetMaterials, but you have to subtract 1 from them.

If called with no arguments, all sub materials will be reset.

Arguments

string material=nil

The material to override the default one with. Set to nil to revert to default material.
Personal tools
Navigation