Entity.SetGravity
From GMod Wiki
Function | |
Syntax | Entity:SetGravity( Float multiplier ) |
Description: | |
Overrides the gravity, as a fraction of the server-wide gravity, on a per entity basis. ( in other words this gets multiplied to the gravity for the specified entity ) | |
Returns: | nil |
In Object: | Entity |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.SetGravity]Entity.SetGravity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | N/A | ||
---|---|---|---|
Used on | |||
Code |
| ||
Output | N/A |
Additional Notes
- This only affects on entities with custom physics, such as Players, NPCs and SMG1 grenades.
- This means it will not work on props, ragdolls etc.
- 1 is full gravity, lesser values decrease gravity.
- You cannot disable gravity fully with this function. Using the value 0 will result in normal behaviour.
- "If you want to apply different gravity to just one [physics object] your best bet is to turn off gravity for that object and apply force to it (that's just what gravity is) in the same way that the hoverball applies force to itself." - Garry [1]