PhysObj.GetMass

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.GetMass( )
Description:
Returns the mass of an object.
Returns: Number
In Object: Physobj
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=PhysObj.GetMass]PhysObj.GetMass [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionGet the Mass of the object the player is pointing at.
Used onNewerShared.png
Code
function GetMass(ply)
    local tr = ply:GetEyeTrace()
    if not tr.Entity then return end
    ply:PrintMessage(HUD_PRINTTALK, tr.Entity:GetPhysicsObject():GetMass())
end
 
OutputThe object's mass

See also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox