MLPlayer.SetGravity(number gravityValue, boolean resetVerticalVelocity = false)
Sets the players gravity value. This value changes the gravitational forces applied to the player. Use SetGravityAxis To set the gravitational directions. The value must be between [-50,50]. Default value is -10.
Parameters:
Name | Type | Description |
---|---|---|
gravityValue | number | New gravity value. Must between -50 and 50. |
resetVerticalVelocity | boolean | Resets the player's current vertical velocity when updating the gravity. |
Usage
---@type MLPlayer
local mlplayer;
---@type number
local gravityValue;
---@type boolean
local resetVerticalVelocity;
mlplayer.SetGravity(gravityValue, resetVerticalVelocity)