PhysObj.GetMass

From GMod Wiki

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