Like the DS BC Material Scalar except it allows four separate values to be used from one behaviour, mapped to the RGBA channels of a vector node. To use this behaviour properly you need to leverage the Unreal materials system – see the Advanced section below and also consult the Unreal Engine documentation on Materials if you are not familiar with the Material system.
Example Usage: You want to make an object glow when its power consumption increases, and to turn from semi-transparent to opaque red when it becomes hot
Step-by-Step: Material Vector Setup – Basic
- Add the DS Material Vector component to an object (see setting up common behaviour parameters)
- In the Data Sources section select the Source Name.
- For each of the 4 dropdowns, select the desired Data Value name (XYZW map to RGBA in the material’s vector parameter node).
- In the Data-driven Behaviour section, set the Affected component dropdown to the component where you want the material to appear.
- In the Material slot, select M_DS_Vector.
- Double-click the M_DS_Vector thumbnail to open the material editor.
- The RGBA sockets on the DS_Colour node correspond to the data values set as XYZW in the Data Sources section. The target object component will now alter properties based on the values set in the XYZW dropdowns.
Step-by-Step: Material Vector Setup – Advanced
- To create your own data-driven material, open or duplicate the existing M_ DS_Vector material, open up an existing material or create a new one.
- If you have duplicated the existing DS material, there will be a Parameter node in the material called DS_Colour.
- If you have created a new material, right-click in an empty area of the material canvas and type into the search box ‘vector parameter’ then select the suggested node.
- The parameter can be named by clicking on the Parameter node you created and naming it in the Node Details panel. This name must match the name in the Behaviour Component’s Material Parameter Name field.
- The RGBA sockets on the DS_Colour node correspond to the data values set as XYZW in the Data Sources section. You can use these in the same way as any material parameter i.e. plug them into other nodes as input values to affect the material property controlled by that node.This can be used as the basis for an advanced data-driven material (See below)
- Ensure that the data range fed in from the behaviour will match the expected input range of the node. Use Data Transforms in the behaviour’s Data Transform section to alter the range if required.