PhysObj.GetMaterial

From GMod Wiki

Jump to: navigation, search
Function
Syntax PhysObj:GetMaterial( )
Description:
Sets the material the physics object is made of.
Returns: String
In Object: PhysObj
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=PhysObj.GetMaterial]PhysObj.GetMaterial [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPrints the physics material.
Used onNewerShared.png
Code
function PhysMaterial(ply) 
	local ent = ply:GetEyeTrace().Entity 
 
	if (ent:IsValid()) then //yup, its a valid entity!
		local phys = ent:GetPhysicsObject()
		if ValidEntity(phys) then
			ply():ChatPrint(phys:GetMaterial())
		end
	end 
end
concommand.Add("GetPhysMaterial", PhysMaterial)
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox