Force Effect Source
Like what your seeing?
Support us as a GitHub Sponsor and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our GitHub Sponsors ... become a sponsor today!
Introduction
A Force Effect Source is a simple component behaviour that describes the origin of a Force Effect. Two main types of Force Effect Sources are provided and described in the articles below.
Related Topics
Custom Source
The Force Effect system is highly customizable and extensible ... you can create a custom Force Effect Source by simply deriving from the ForceEffectSource behavior.
The only required feature is the AddForce method which takes 4 parameters
Subject
This is the Physics Data of the receiver a powerful feature that describes all physical aspects of the subject
Sensitivity
This describes the sensitivity of the object to any effect and is a simple scalar e.g. 0 means you can ignore the effect any non-zero value should be used to scale the effect.
Use Angular
Is the subject listening for angular effects, if false you should not operate the effects angular methods
Use Linear
Is the subject listening for linear effects, if false you should not operate the effects linear methods
Custom Effect Tips
Global
We often want to apply an effect globally to all listeners that would have it. To do so we need to add the effect to the API.ForceEffect.GlobalEffects list ... and we need to remove the effect when its no longer applicable.
The approach Heathen uses is to expose an Is Global field
And to set the value on enable of the source
And remove it on disable
Effects
Which effects your custom source applies is up to you. Heathen's standard sources make this configurable, exposing a list of Force Effect to the editor and then simply iterating over those when AddForce is called.
Last updated