Skip to main content
Member of ML.SDK.MLPlayer
Method

void MLPlayer.SetGravity(float gravity, bool resetVerticalVelocity = false)

 void MLPlayer.SetGravity(float gravity, bool resetVerticalVelocity = false);

Parameters

ParameterTypeDescription
gravityfloatNew gravity value. Must between -50 and 50.
resetVerticalVelocityboolIf set true, resets the player vertical velocity that might have resulted by the previous gravity value (falling)

Returns

void

Summary

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.