Garry's Mod Wiki

Garry's Mod Wiki

  Entity:SetMaterial( string materialName )

Description

Sets the rendering material override of the entity.

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

If you wish to override a single material on the model, use Entity:SetSubMaterial instead.

To apply materials to models, that material must have VertexLitGeneric shader. For that reason you cannot apply map textures onto models, map textures use a different material shader - LightmappedGeneric, which can be used on brush entities.
The server's value takes priority on the client.

Issue Tracker: 3362

Arguments

1 string materialName
New material name. Use an empty string ("") to reset to the default materials.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...