Within each Behaviour Components, there is a built in Data Transform function, which can be configured via the details panel.
This allows the data to be manipulated in a number of useful ways. Often incoming data needs to be altered to be consumed by a behaviour e.g. where a material needs a number between 0 and 1. Whilst processing the data outside Unreal is possible, in some cases you want the freedom to tweak the numbers in the editor in realtime to get the desired effect for different objects which are showing the same data e.g. For a bar in a graph you want the input value to scale the bar in a 0-10 range, but to change its colour with the same input, you need a value from 0-1.
There are 3 key transform functions in the details panel for each behaviour:
- Multiplier Function – this is useful for a straightfoward multiplication of the incoming value.
- Example: Input Value is a percentage in 0-100 range and needs to be converted to 0-360 for a rotation angle on a dial. A 3.6 multplier value is used.
- Input Threshold Function – this allows setting a response range as a subset of the incoming data. It is also used to set the incoming range expected when using Output Mapping. A lower and upper cutoff can be set, along with snapping behaviours for how to handle the value going above/below the threshold range.
- Example: Input Value is 0-100, but you have an array of 5 components which react to a subset sequentially. The first object needs 0-20, the second 21-40 etc.
- Output Mapping Function (only visible when Input Threshold is set) – with the input threshold set to expected min and max incoming values, the output mapping function can be set to a desired output range.
- _Example: You have a range of 100,000 to 100,005, and want to output as a value from 0-1.