The Material Modifier adjusts an object's Visual Materials during gameplay.
To shift a material's color gradually, connect the Color Mix to this node and time it with e.g. Wave.
Scroll down to see the step-by-step instructions!
Target | Set the object whose Visual Material will be adjusted. If there is no target,the node will affect all objects that use the selected Visual Material |
Execute | Executes the node |
↳ On Start | Executes the node at the start of the game |
Enabled | Enable or disable the node. Disabled nodes cannot be executed |
Apply to Children | If toggled on, Material Modifier will also affect objects that have been attached to the target Note: Only visible if the node has a target |
Slot Index | Select which of the target object's Visual Material Slots will be modified. Note: Only visible if the node has a target |
Material | Set the Visual Material that the node will affect. Has an effect on all objects that use the selected material. Note: Only visible if the node has no target |
Diffuse | Set a new color for the Visual Material either manually or with an input link from an other node |
Material Modifier can change the color of the target material instantly, but paired with Wave & Color Mix nodes the Material Modifier can gradually adjust a color over time. To achieve this, you need to send a Color Vector to the Diffuse input of the Material Modifier. Vectors will be interpreted as RGBA color data (red, green, blue, alpha). Vectors can also be sent to the Material Modifier by Vector and Color nodes.
In the Material Modifier, set the Target Object and select the Material Slot you'd like to modify. In this example, the green material of the cube is in Slot One.
In the Color Mix node, set the 2 colors you'd like to mix.
- Color A should be the original color in the Visual Material
- Color B should be the color you'd like to change it to
In the Wave node, set the time that the color change should take with the Duration values. Set the Wave to Loop if you want a continuous change. By default the Wave node's On Start is toggled on: this will execute the node when the game play starts.
Finally, create two red executing links:
Playtest to see the color change!
Here's a link to a demo that shows how to use the Material Modifier node: