Force Effect Framework
PhysKit's Force Effect framework is a simple structure that allows the designer to tailor physical environments in editor for quick iteration.
You can use Force Effects to create global or localized forces the system is composed of three basic parts
These describe how a force is applied to a body and go beyond Unity's "mode" concept.
For example a "wind force" would likely have a degree of turbulence adjusting its direction and would apply its force based on quadratic drag ... that is an object with more drag would experience more wind force than an object with less drag.
Gravity in contrast to wind applies a constant acceleration force toward its point of origin, so with a single point of origin we can simulate spherical gravity while an origin direction would allow us to simulate localized gravity similar to a body on a planet which brings us nicely into Force Effect Sources.
A Force Effect Source describes the origin and strength of a force and allows us to declare this force global or not and to limit the effects to linear and or angular.
Global Force Effect Sources are managed by the static ForceEffects API and are read by all valid receivers.
Local (non-global) sources only effect receivers that have triggered them.
How you decide what sources are triggered is up to you though we have built in a system using Unity's Collider Is Trigger features.
Receivers will test On Trigger Enter and On Trigger Exit to determine if they have entered or exited the trigger collider of a source and will activate that source on themselves is so and if not ignored.
A Force Effect Receiver is simply the interface point for the system to operate on a body. When added to a Rigidbody it will automatically add a Physics Data component providing enhanced physical information about the subject.
Many a space game and cute god games depend on spherical gravity calculations. Unity's built in gravity makes the assumption that its always directional. By using a Force Effect Field and the Gravity Effect you can you can not only apply spherical gravity but have its strength tapper off the further you get from the source of gravity.
Creating a physics based platformer? want gravity platforms, or maybe you want different subjects to experience different gravity and different times. Use a Force Effect Direction (or many) and apply the Gravity Effect. You can now use the ignore list on receivers to control what effect which bodies experience or you can make these non-global and use simple triggers to know what gravity a body experiences even multiple sources of gravity at once.
Love those racing games and shooters where some platform on the ground massively accelerates you or slogs you down like your moving through soup. Use a Force Effect Field or Direction with the Suspend effect to scale down or up the subjects velocity.