PhysObj.ApplyForceOffset

From GMod Wiki

Jump to: navigation, search
Function
Syntax PhysObj.ApplyForceOffset( Vector force, Vector position )
Description:
Applies a force to an object on the given position, so it also adds torque
Returns: nil
In Object: Physobj
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=PhysObj.ApplyForceOffset]PhysObj.ApplyForceOffset [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Example

DescriptionThis example makes all prop_physics shoot up a ways with a little torque
Used onNewerServer.png
Code
local props = ents.FindByClass( "prop_physics" )
for _, prop in ipairs( props ) do
  prop:GetPhysicsObject():ApplyForceOffset(Vector( 0, 0, 900 ),Vector(0,0,0) )
end
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox