It's an addon allowing you to easily implement custom gravity into your game. You can create different zones with their own gravity that will affect the player.
The goal is to be able to make gravity zones just like in Mario Galaxy
Here is a list of demos :
Directional Gravity
Sphere Gravity
Pill shaped gravity
Pyramid shaped gravity
Gravity current
Other shapes
Before going into it, here's words and definitions:
- Provider -> Node that returns the gravity applied to the body
- Detector -> Area3D detecting body entering and asigning a Provider to it
- GravityBody -> a RigidBody
The GravityBody3D is a RigidBody3D that can be influenced by our custom gravity. If you don't set the base gravity scale to zero, the body will be influenced by both the custom and the project's gravity. Call get_custom_gravity instead of get_gravity to get the applied gravity.
The GravityCharacter3D is just a CharacterBody3D with the get_custom_gravity mechanics. Use it as you see fit.
The GravityDetector3D is an Area3D that will asign its gravity provider to an entering GravityBody3D. Enabling the space override in the gravity section is necessary to apply the gravity.
You can set gravity falloff with a curve. You can make so the closer you are from an object the stronger its gravity will be. Play with the values, the possibilities are endless!
You can set the force of the gravity, call the get_custom_gravity to get the Vector of the gravity.
This is used for flat surfaces. the same gravity will be applied everywhere, you just set the direction of it.
The gravity applied will be like one of a planet.
The gravity applied to the body will be calculated with the position of the body relative to the nearest point on the curve. You can set the force of the gravity and chose the number of "faces" your path will have. For example, with no faces, the "shape" of the gravity will be like a pill. If you have "faces", the "shape" of the gravity could look like this. The "Peak" option allows you to make pyramids & cones, the tilt of the gravity depends on the height and radius values. A height and a radius of 5 will make a 45 degrees angle. For the "gravity curren" you just need to set the height to any number and the radius to 0.
You will also have a custom gizmo for each GravityProvider
Normal Particles in godot can't be affected by in-game gravity so I made my own particles. This option is very limited but is very usefull in the editor for figuring out how the gravity is behaving.
















