PhysObj.GetVolume

From GMod Wiki

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