warning Not Translated
This page has not been translated into the language that your browser requested yet. The English content is being shown as a fallback.
If you want to contribute a translation for this page then please click here.
SetGravity
Description
Set the gravity for all players.
Name | Description |
---|---|
Float:gravity | The value that the gravity should be set to (between -50.0 and 50.0). |
Returns
This function always returns 1, even when it fails to execute if the gravity is out of the limits (lower than -50.0 or high than +50.0).
Examples
public OnGameModeInit()
{
// Set moon-like gravity
SetGravity(0.001);
return 1;
}
Notes
warning
Default gravity is 0.008.
Related Functions
- GetGravity: Get the currently set gravity.
- SetPlayerGravity: Set a player's gravity.
- SetWeather: Set the global weather.
- SetWorldTime: Set the global server time.