Garry's Mod Wiki

Garry's Mod Wiki

  PhysObj:SetMaterial( string materialName )

Description

Sets the material of the physobject.

Impact sounds will only change if this is called on client

Arguments

1 string materialName
The name of the phys material to use. From this list: Valve Developer

Example

Randomize the physical properties of an entity

local tbl = { "gmod_ice", -- Makes the entity slide around "gmod_bouncy", -- Makes the entity bouncy "gmod_silent", -- Makes the entity not play sounds on impact "flesh" -- Makes the entity play flesh sounds on impact } local phys = SomeEntity:GetPhysicsObject() if ( IsValid( phys ) ) then phys:SetMaterial( table.Random( tbl ) ) end

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...