Intermediate

Complete reference for all 6 input and material operations: create input actions, mapping contexts, add mappings, create and configure material instances.

unreal_input_materials

The unreal_input_materials tool covers Enhanced Input setup and material instance management. It exposes 6 operations for creating input actions, building mapping contexts, adding key bindings, and creating and configuring material instances.

Operations at a Glance

OperationHintDescription
create_input_actionCreate an Enhanced Input action asset
create_mapping_contextCreate an Input Mapping Context asset
add_mappingAdd an action mapping to a context with key bindings
create_material_instanceCreate a Material Instance from a parent material
set_material_parametersidempotentSet scalar, vector, and texture parameters on an instance
get_material_inforeadOnlyGet all parameters and their current values from a material

create_input_action

Creates a new Enhanced Input UInputAction asset. Input Actions define what player actions exist (Jump, Attack, Move) independently of which keys trigger them.

Parameters

ParameterTypeRequiredDescription
pathstringyesDestination content path including asset name
value_typestringyesAction value type: bool, axis1d, axis2d, axis3d
triggersarraynoDefault trigger types to add: pressed, released, held, tap, double_tap
modifiersarraynoDefault modifier types: negate, swizzle, dead_zone, scalar
{
  "operation": "create_input_action",
  "params": {
    "path": "/Game/Input/Actions/IA_Jump",
    "value_type": "bool",
    "triggers": ["pressed"]
  }
}
{
  "operation": "create_input_action",
  "params": {
    "path": "/Game/Input/Actions/IA_Move",
    "value_type": "axis2d"
  }
}
{
  "operation": "create_input_action",
  "params": {
    "path": "/Game/Input/Actions/IA_Look",
    "value_type": "axis2d",
    "modifiers": ["dead_zone"]
  }
}

Response

{
  "path": "/Game/Input/Actions/IA_Jump",
  "value_type": "bool",
  "created": true
}

Note: Input Actions define the semantic intent of player input — not the physical key. Physical key bindings are added separately via add_mapping on a Mapping Context.

create_mapping_context

Creates a new UInputMappingContext asset. Mapping Contexts group a set of action-to-key bindings that can be activated and deactivated together at runtime.

Parameters

ParameterTypeRequiredDescription
pathstringyesDestination content path including asset name
priorityintegernoDefault priority when added to the player. Higher values take precedence. Default: 0.
{
  "operation": "create_mapping_context",
  "params": {
    "path": "/Game/Input/IMC_Default",
    "priority": 0
  }
}
{
  "operation": "create_mapping_context",
  "params": {
    "path": "/Game/Input/IMC_UI",
    "priority": 10
  }
}

Response

{
  "path": "/Game/Input/IMC_Default",
  "priority": 0,
  "created": true
}

add_mapping

Adds an action-to-key binding to an existing Mapping Context. Each call adds one mapping entry.

Parameters

ParameterTypeRequiredDescription
contextstringyesFull content path of the Mapping Context
actionstringyesFull content path of the Input Action
keystringyesKey identifier string (see key names below)
modifiersarraynoModifiers to apply to this mapping: negate, swizzle, dead_zone, scalar
triggersarraynoTriggers for this specific mapping: pressed, released, held

Common Key Names

Key StringPhysical Key
SpaceBarSpace
LeftMouseButtonLeft click
RightMouseButtonRight click
W, A, S, DWASD
Gamepad_FaceButton_BottomXbox A / PS Cross
Gamepad_FaceButton_RightXbox B / PS Circle
Gamepad_LeftXLeft stick horizontal axis
Gamepad_LeftYLeft stick vertical axis
Gamepad_RightXRight stick horizontal axis
Gamepad_RightYRight stick vertical axis
Gamepad_LeftTriggerAxisLeft trigger
Gamepad_RightTriggerAxisRight trigger
Gamepad_LeftShoulderLB / L1
Gamepad_RightShoulderRB / R1
{
  "operation": "add_mapping",
  "params": {
    "context": "/Game/Input/IMC_Default",
    "action": "/Game/Input/Actions/IA_Jump",
    "key": "SpaceBar"
  }
}
{
  "operation": "add_mapping",
  "params": {
    "context": "/Game/Input/IMC_Default",
    "action": "/Game/Input/Actions/IA_Jump",
    "key": "Gamepad_FaceButton_Bottom"
  }
}
{
  "operation": "add_mapping",
  "params": {
    "context": "/Game/Input/IMC_Default",
    "action": "/Game/Input/Actions/IA_Move",
    "key": "Gamepad_LeftY",
    "modifiers": ["dead_zone"]
  }
}

Tip: Call add_mapping once per key binding. To add both keyboard and gamepad bindings for the same action, call it twice with different key values — both mappings live in the same context.

create_material_instance

Creates a new UMaterialInstance asset derived from a parent material. Material instances let you vary parameters (colors, textures, scalars) without creating a new material shader.

Parameters

ParameterTypeRequiredDescription
pathstringyesDestination content path including asset name
parentstringyesFull content path of the parent material
{
  "operation": "create_material_instance",
  "params": {
    "path": "/Game/Materials/MI_Rock_Mossy",
    "parent": "/Game/Materials/M_Rock_Base"
  }
}
{
  "operation": "create_material_instance",
  "params": {
    "path": "/Game/Characters/Enemies/MI_Goblin_Green",
    "parent": "/Game/Characters/Enemies/M_Goblin_Base"
  }
}

Response

{
  "path": "/Game/Materials/MI_Rock_Mossy",
  "parent": "/Game/Materials/M_Rock_Base",
  "created": true
}

set_material_parameters

Sets scalar, vector, and texture parameters on a material instance. Only overrides the parameters you specify — all others inherit from the parent.

Parameters

ParameterTypeRequiredDescription
pathstringyesFull content path of the material instance
scalarsobjectnoMap of scalar parameter names to float values
vectorsobjectnoMap of vector parameter names to { r, g, b, a } objects
texturesobjectnoMap of texture parameter names to full content paths
{
  "operation": "set_material_parameters",
  "params": {
    "path": "/Game/Materials/MI_Rock_Mossy",
    "scalars": {
      "Roughness": 0.8,
      "Metallic": 0.0,
      "MossAmount": 0.6
    },
    "vectors": {
      "BaseColor": { "r": 0.18, "g": 0.28, "b": 0.14, "a": 1.0 }
    },
    "textures": {
      "DiffuseTexture": "/Game/Textures/T_Rock_Mossy_D",
      "NormalMap":      "/Game/Textures/T_Rock_Mossy_N"
    }
  }
}
{
  "operation": "set_material_parameters",
  "params": {
    "path": "/Game/Characters/Enemies/MI_Goblin_Green",
    "scalars": {
      "EmissiveStrength": 0.0
    },
    "vectors": {
      "SkinTint": { "r": 0.22, "g": 0.45, "b": 0.12, "a": 1.0 }
    }
  }
}

Note: set_material_parameters is tagged idempotentHint. Applying the same parameters twice produces the same result. Safe to parallelize across different material instance paths.

get_material_info

Returns all parameters defined in a material or material instance, along with their current values and whether they are overriding the parent.

Parameters

ParameterTypeRequiredDescription
pathstringyesFull content path of the material or material instance
{
  "operation": "get_material_info",
  "params": {
    "path": "/Game/Materials/MI_Rock_Mossy"
  }
}

Response

{
  "name": "MI_Rock_Mossy",
  "parent": "/Game/Materials/M_Rock_Base",
  "scalars": [
    { "name": "Roughness",   "value": 0.8,  "overriding": true  },
    { "name": "Metallic",    "value": 0.0,  "overriding": true  },
    { "name": "MossAmount",  "value": 0.6,  "overriding": true  },
    { "name": "Opacity",     "value": 1.0,  "overriding": false }
  ],
  "vectors": [
    { "name": "BaseColor", "value": { "r": 0.18, "g": 0.28, "b": 0.14, "a": 1.0 }, "overriding": true }
  ],
  "textures": [
    { "name": "DiffuseTexture", "value": "/Game/Textures/T_Rock_Mossy_D", "overriding": true  },
    { "name": "NormalMap",      "value": "/Game/Textures/T_Rock_Mossy_N", "overriding": true  },
    { "name": "RoughnessMap",   "value": "/Game/Textures/T_Rock_Rough",   "overriding": false }
  ]
}

Note: get_material_info is tagged readOnlyHint — safe to parallelize with other read-only calls.

Complete Workflow: Enhanced Input Setup

// 1. Create input actions (can parallelize — independent assets)
await parallel([
  create_input_action({ path: "/Game/Input/Actions/IA_Jump",   value_type: "bool",   triggers: ["pressed"] }),
  create_input_action({ path: "/Game/Input/Actions/IA_Move",   value_type: "axis2d" }),
  create_input_action({ path: "/Game/Input/Actions/IA_Look",   value_type: "axis2d", modifiers: ["dead_zone"] }),
  create_input_action({ path: "/Game/Input/Actions/IA_Attack", value_type: "bool",   triggers: ["pressed"] }),
])

// 2. Create the mapping context
await create_mapping_context({ path: "/Game/Input/IMC_Default", priority: 0 })

// 3. Add keyboard mappings
await add_mapping({ context: "/Game/Input/IMC_Default", action: "/Game/Input/Actions/IA_Jump",   key: "SpaceBar" })
await add_mapping({ context: "/Game/Input/IMC_Default", action: "/Game/Input/Actions/IA_Attack", key: "LeftMouseButton" })

// Move uses 4 keys (WASD) — add each separately
await add_mapping({ context: "/Game/Input/IMC_Default", action: "/Game/Input/Actions/IA_Move", key: "W", modifiers: [] })
await add_mapping({ context: "/Game/Input/IMC_Default", action: "/Game/Input/Actions/IA_Move", key: "S", modifiers: ["negate"] })
await add_mapping({ context: "/Game/Input/IMC_Default", action: "/Game/Input/Actions/IA_Move", key: "D", modifiers: ["swizzle"] })
await add_mapping({ context: "/Game/Input/IMC_Default", action: "/Game/Input/Actions/IA_Move", key: "A", modifiers: ["swizzle", "negate"] })

// 4. Add gamepad mappings
await add_mapping({ context: "/Game/Input/IMC_Default", action: "/Game/Input/Actions/IA_Jump",   key: "Gamepad_FaceButton_Bottom" })
await add_mapping({ context: "/Game/Input/IMC_Default", action: "/Game/Input/Actions/IA_Attack", key: "Gamepad_RightTriggerAxis" })
await add_mapping({ context: "/Game/Input/IMC_Default", action: "/Game/Input/Actions/IA_Move",   key: "Gamepad_LeftY" })
await add_mapping({ context: "/Game/Input/IMC_Default", action: "/Game/Input/Actions/IA_Move",   key: "Gamepad_LeftX", modifiers: ["swizzle"] })
await add_mapping({ context: "/Game/Input/IMC_Default", action: "/Game/Input/Actions/IA_Look",   key: "Gamepad_RightX" })
await add_mapping({ context: "/Game/Input/IMC_Default", action: "/Game/Input/Actions/IA_Look",   key: "Gamepad_RightY", modifiers: ["negate"] })

Complete Workflow: Material Variant Set

// 1. Get the parent material's parameter list
const info = await get_material_info({ path: "/Game/Materials/M_Rock_Base" })

// 2. Create multiple instance variants (parallelize — different paths)
await parallel([
  create_material_instance({ path: "/Game/Materials/MI_Rock_Mossy", parent: "/Game/Materials/M_Rock_Base" }),
  create_material_instance({ path: "/Game/Materials/MI_Rock_Dry",   parent: "/Game/Materials/M_Rock_Base" }),
  create_material_instance({ path: "/Game/Materials/MI_Rock_Snow",  parent: "/Game/Materials/M_Rock_Base" }),
])

// 3. Set parameters on each variant (parallelize — different paths)
await parallel([
  set_material_parameters({
    path: "/Game/Materials/MI_Rock_Mossy",
    scalars: { Roughness: 0.8, MossAmount: 0.7 },
    vectors: { BaseColor: { r: 0.18, g: 0.28, b: 0.14, a: 1.0 } },
    textures: { DiffuseTexture: "/Game/Textures/T_Rock_Mossy_D" }
  }),
  set_material_parameters({
    path: "/Game/Materials/MI_Rock_Dry",
    scalars: { Roughness: 0.95, MossAmount: 0.0 },
    vectors: { BaseColor: { r: 0.42, g: 0.38, b: 0.30, a: 1.0 } },
    textures: { DiffuseTexture: "/Game/Textures/T_Rock_Dry_D" }
  }),
  set_material_parameters({
    path: "/Game/Materials/MI_Rock_Snow",
    scalars: { Roughness: 0.6, MossAmount: 0.0, SnowAmount: 0.9 },
    vectors: { BaseColor: { r: 0.9, g: 0.92, b: 0.95, a: 1.0 } },
    textures: { DiffuseTexture: "/Game/Textures/T_Rock_Snow_D" }
  }),
])