add_cast_node
Adds a Cast To node to a Blueprint graph, compiles the Blueprint, and returns the node with its pins for immediate wiring.
Instructions
Add an IMPURE Cast To node (exec in, Cast Succeeded / Cast Failed out) and compile the Blueprint. Same node as add_graph_node node_type="cast", which does NOT compile -- use that one inside a build_blueprint_graph batch. Skip the cast entirely when it only exists to type a GetComponentByClass result: add_get_component_by_class_node returns a ReturnValue pin already typed to the component class.
Returns: { node_id, class, title, pins:[...], blueprint_name, graph_name, cast_to } -- the node WITH its pins ('execute', 'Object', 'then'/Cast Succeeded, 'CastFailed', 'As'), so it can be wired without a follow-up read.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Optional. This command is REFUSED while a Play-in-Editor session is running: it either compiles a Blueprint (the reinstancer can retain a world, and CheckForWorldGCLeaks is Fatal -- it KILLS the editor) or writes to disk (Editor.AllowSavingAssetsDuringPIE=0 makes the engine refuse the write, so it would report success without writing a byte). Stop PIE and retry instead; force=true runs it anyway, at your own risk. | |
| graph_name | No | Target graph name; defaults to the Blueprint's event graph when omitted | |
| position_x | No | Node X position on the graph canvas (ignored when node_position is set) | |
| position_y | No | Node Y position on the graph canvas (ignored when node_position is set) | |
| target_class | No | Alias accepted instead of target_class_name (same meaning); one of the two is required. | |
| node_position | No | Node canvas position as [x, y]; takes precedence over position_x/position_y | |
| blueprint_name | No | Name (or full object path) of the Blueprint. | |
| blueprint_path | No | Alias of `blueprint_name` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `blueprint_name`. | |
| target_class_name | No | Class to cast to: a name ("Pawn", "Character"), a /Script/Module.Class path, or a Blueprint generated-class path (/Game/Dir/BP_X.BP_X_C). |