PhysObj.GetVolume

From GMod Wiki

Revision as of 14:49, 13 September 2009 by UnrealomegaBot (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax PhysObj.GetVolume( )
Description:
Returns the volume of a physics object.
Returns: Number
In Object: Physobj
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=PhysObj.GetVolume]PhysObj.GetVolume [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionGet the volume of the object the player is pointing at.
Used onNewerShared.png
Code
function GetVolume( ply )
    local tr = ply:GetEyeTrace()
    local trEnt = tr.Entity
    if ( !ValidEntity( trEnt ) ) then return end
    ply:PrintMessage( HUD_PRINTTALK, trEnt:GetPhysicsObject():GetVolume() )
end
 
OutputThe object's volume

See also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox