This C# script allows creating a gravity zone for any Rigidbody object. With one simple script, any object can be attracted to a planet.
In Unity, it is simple to add gravity when a single
gameObject manages is. That is why a
isTrigger checked as
true must be used. Any object in this region will be affected by gravity.
This code can be used for anything as long as Denis Labrecque is appropriately credited.