add_set_material_node
Add a Set Material node to a Blueprint event graph to swap an actor's material when a specified event, such as a hit, occurs.
Instructions
Add a "Set Material" node to a Blueprint event graph triggered by an event.
This creates the core gameplay interaction from Ch. 5: detecting a hit on an actor and swapping its material (e.g., cylinder turns red when shot).
Args: blueprint_name: Target Blueprint (e.g., "BP_CylinderTarget") component_name: Mesh component name (e.g., "StaticMeshComponent") material_path: Material asset path (e.g., "/Game/Materials/M_TargetRed") event_name: Event that triggers the material change ("ReceiveHit", "ReceiveBeginPlay") node_position: [X, Y] position in graph
KB: see knowledge_base/08_MATERIALS_AND_RENDERING.md#overview Example: add_set_material_node(blueprint_name="/Game/MCP_Test/BP_Example", component_name="ExampleComponent", material_path="/Game/MCP_Test/M_Example")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_name | No | ReceiveHit | |
| material_path | Yes | ||
| node_position | No | ||
| blueprint_name | Yes | ||
| component_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |