In this simple recipe, we will look at utilizing the GravityBox to set up a low gravity area within a level.
Keeping the default dimensions (20, 20, 20 meters), the only property here that we want to change is the gravity. The default settings in this box set this entire area within the level to be a zero gravity zone. To adjust the up/down gravity of this, we need to change the value of gravity and the Z axis.
To mimic normal gravity, this value would need to be set to the acceleration value of -9.81
. To change this value to a lower gravity value, (something like the Moon's gravity) simply change it to a higher negative value such as -1.62
.
The GravityBox is a simple bounding box which overrides the defined gravity in the code (-9.81) and sets its own gravity value within the bounding box. Anything physicalized and activated to receive physics updates will behave within the confines of these gravitational rules unless they fall outside of the bounding box.
Here are some useful tips about the gravity objects.
The uniform property within the GravityBox defines whether the GravityBox should use its own local orientation or the world's. If true, the GravityBox will use its own local rotation for the gravitational direction. If false, it will use the world's direction. This is used when you wish to have the gravity directed sideways. Set this value to True
and then rotate the GravityBox onto its side.
3.135.204.0