Knowledge base
Knowledge base
Knowledge base
Free, anonymous browsing of Unreal Engine Blueprint examples, node references, and best practices. The same content the WoalzCraft plugin uses to generate Blueprints.
25 results for Class Reference
A reference to a class (not an instance). Use as input to SpawnActor or to compare types.
K2Node_SpawnActorFromClass. Class pin is a class reference dropdown.
SpawnActorFromClassUE 5.4, 5.7updated 2mo agoWhy: Your Cast To node references the class '{class}' which has been removed or renamed since you added the cast. Fix: Click the Cast To node. In Details panel, click the dropdown next to 'Cast To Class' and re-select the actual current class. If the class is truly gone, replace this Cast with an Interface call or a different type test.
Why: Your code reads from a '{ref}' reference, but nothing was assigned to it. UE5 doesn't error at compile time, but warns that the runtime access will crash with null-pointer. Fix: Wherever this BP spawns, set the reference via Spawn Actor From Class → Set Reference. If it should be set from outside, expose the variable (eye-icon = Instance Editable) so it's set in the level editor. Add an Is Valid? Branch before each read to gracefully handle null.
K2Node_CreateWidget. Class is the Widget Blueprint class reference.
Create WidgetUE 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoSafely converts an Object Reference to a more specific class. Branch on the Failed output — casting to the wrong class returns null.
Why: Your save logic targets the SaveGame class '{cls}', but that asset is gone. The save call would fail at runtime. Fix: Find your existing SaveGame subclass in Content Browser (search for 'SaveGame'). If still there but renamed: update the Cast To node + Class pin. If gone: create a new SaveGame Blueprint (Right-click → Blueprint Class → SaveGame parent), copy your fields back, and re-point save/load calls at it.
Why: The variable '{name}' is typed as something that no longer exists in your project. This happens when you delete or rename a Blueprint, Struct, or Class that other variables referenced — UE5 leaves the reference dangling. Fix: Open the Blueprint that owns '{name}' (in the Errors panel, click the file link). In My Blueprint panel, click '{name}' to select. In Details panel, change Variable Type to a valid type, or delete the variable entirely and remove all references.
Pattern: EventBeginPlay → CreateWidget(OwningPlayer=GetPlayerController, WidgetType=WBP_MyWidget) → SetVariable(HUDWidget=ReturnValue) → CastTo<WBP_MyWidget>(HUDWidget) → Cast Succeeded → AddToViewport(ZOrder=0). Always store widget reference in a variable. CreateWidget inputs: 'OwningPlayer' (PlayerController) and 'WidgetType' (class). Exec in='execute', exec out='then'.
A pointer to a UObject instance. If the target is destroyed the reference becomes invalid — always IsValid-check before use.