set_bp_variable_metadata
Set editor-facing checkboxes and text on an existing Blueprint variable: instance editability, SaveGame serialization, SpawnActor exposure, category, and tooltip. Only supplied fields change.
Instructions
Set the editor-facing checkboxes and text of an existing Blueprint variable: instance_editable (per-instance editability), save_game (CPF_SaveGame -- whether the variable goes into a .sav), expose_on_spawn (adds the variable as a pin on SpawnActor), category and tooltip. Only the fields present are touched; passing none is an error. This is the fix for a variable created by add_blueprint_variable, which is born NOT instance-editable while the readers report it as editable. Variable must be declared on THIS Blueprint; on a library variable the answer is a child class of your own, not this call. WARNING: this call does NOT compile: it structurally-modifies the Blueprint, which regenerates the SKELETON only, so a save_game just written is authored but NOT yet on the generated class the save archive reads -- the response says so in save_game_needs_compile, and the loop that finishes the job is compile_blueprint -> save_asset -> get_blueprint_variable_detailed_info and check save_game_generated.
Returns: { blueprint_name, variable_name, updated, save_game?, save_game_generated?, save_game_needs_compile? } -- updated:true only means at least one field was applied, not that it persisted. The three save_game_* fields appear only when save_game was passed, and are READ BACK after the write: save_game off the variable descriptor, save_game_generated off the FProperty of the generated class.
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. | |
| tooltip | No | Tooltip text shown for the variable | |
| category | No | Category to group the variable under in the editor | |
| save_game | No | true = tick "SaveGame" (CPF_SaveGame), so a SaveGame archive (ArIsSaveGame) serializes this variable; false unticks it. The only headless way to set this flag -- set_property_value, Python, set_bp_variable_replication and BlueprintEditorLibrary all refuse it. Needs a compile to reach the generated class. | |
| variable_name | Yes | Name of a variable declared on THIS Blueprint (inherited ones are refused). | |
| blueprint_name | No | Blueprint name or path. | |
| blueprint_path | No | Alias of `blueprint_name` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `blueprint_name`. | |
| expose_on_spawn | No | true = the variable shows up as an input pin on SpawnActorFromClass. Verify on the NODE's pins, not on get_blueprint_variables' expose_on_spawn, which reports false for variables that ARE exposed. | |
| instance_editable | No | true = editable on each placed actor. Verify by WRITING the placed instance and reading it back; the reporting field is unreliable for every variable. |