Entity.GetPhysicsObjectCount

From GMod Wiki

Revision as of 20:53, 5 October 2009 by Crazy Quebecer (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax Entity:GetPhysicsObjectCount( )
Description:
Returns the number of physics objects in this (if this is a ragdoll it will be greater then 1 )
Returns: Integer
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetPhysicsObjectCount]Entity.GetPhysicsObjectCount [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionFinds all the PhysicsObjects of a ragdoll and send them flying.
Used onNewerShared.png
Code
local i = 0
while i < Ragdoll:GetPhysicsObjectCount() do
 
    Ragdoll = ent:GetPhysicsObjectNum(i) -- "ent" being a ragdoll entity
    Ragdoll:ApplyForceCenter( Vector( 0, 0, 10000  )
    i = i + 1
end
OutputApplys a force to every Physobject Object upwards


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox