Visualizing Gravity

Unity has a pretty cool feature called “gizmos”, that are things rendered only in the scene view of the Unity editor. Many built in game object types render a gizmo of some sort, but you can freely add your own. This can be very useful for debugging.

This is a visualization of the gravity (more precisely it’s the low resolution grid of gravity mentioned in the previous post).

The direction of the line is the direction of the gravity, and the length is the strength.