physenv.SetGravity

From GMod Wiki

Revision as of 20:02, 14 November 2010 by Entoros (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax physenv.SetGravity( Vector Direction )
Where is this used?
Description:
Sets the gravitational direction for physics objects.
Returns: nil
Part of Library: physenv
Realm: NewerShared.png
Error.png Warning: This is a dangerous function. Use it with care!
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Physenv.SetGravity]Physenv.SetGravity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Example

DescriptionCreates a console command "gosideways" which will cause all physics objects to fly sideways upon entering it into the console.
Used onNewerServer.png
Code
 
function ccGoSideways( ply, cmd, args )
 
  physenv.SetGravity( Vector( 600, 0, 0 ) )
 
end
concommand.Add( "gosideways", ccGoSideways )
 
OutputN/A


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox