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.
21 results for reuse
Variables in pool manager (GameMode or Subsystem): Pool (Array<Actor>), PoolClass (TSubclassOf<Actor>). Init: Loop N times → SpawnActorFromClass → SetActorHiddenInGame(true) → SetActorEnableCollision(false) → SetActorTickEnabled(false) → Array Add to Pool. GetFromPool: ForEachLoop(Pool) → GetActorHiddenInGame → Branch(true) → SetActorHiddenInGame(false) → SetActorEnableCollision(true) → SetActorTickEnabled(true) → SetActorLocationAndRotation → Return actor. If none available: SpawnActorFromClass. ReturnToPool: SetActorHiddenInGame(true) → SetActorEnableCollision(false) → SetActorTickEnabled(false) → SetActorLocation(far away or (0,0,-9999)).
Must call this before SetScalarParameterValue/SetVectorParameterValue. Store the result in a variable for reuse.
CreateDynamicMaterialInstanceUE 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoCREATE: New Blueprint → parent class UActorComponent (or USceneComponent if needs transform). Add variables (Health, MaxHealth). Add EventBeginPlay (available in component). Add custom events/functions (TakeDamage, Heal, OnDeath). ADD TO ACTOR: In your Actor BP → Add Component → search for your component class. Or: SpawnActorFromClass → GetComponentByClass → CastTo<BP_HealthComponent>. CROSS-COMMUNICATION: In Component's OnDeath → GetOwner → CastTo<BP_Character> → call OnCharacterDied. Or: Component has Event Dispatcher 'OnDied' → owner binds to it. BENEFIT: Reuse HealthComponent on Enemy, Player, Vehicle without code duplication.
UPrimitiveComponent method. Store result in variable and reuse. Create once in BeginPlay.
Create Dynamic Material InstanceUE 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoA named, reusable subgraph with inputs + outputs. Cleaner than copy-pasting node clusters.
Pattern: Pickup actor with SphereCollision(overlap), StaticMesh visual. OnComponentBeginOverlap → CastTo PlayerCharacter → Success: call AddScore/AddItem interface on player → PlaySoundAtLocation → SpawnEmitterAtLocation → DestroyActor(self). Set collision to OverlapOnlyPawn for performance.
An inline-expanded subgraph. Like a function but each use creates a fresh copy at compile time (faster, but more bytecode).
For non-Actor objects (UObjects). Actors must use SpawnActorFromClass instead. Outer is usually 'self' or GetTransientPackage().
NewObjectUE 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo ago0 = live forever.
Set Life SpanUE 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoCreate struct FInventoryItem: {ItemName (Name), ItemCount (int), ItemData (object ref)}. Variable: Inventory (Array<FInventoryItem>). AddItem: ForEachLoop(Inventory) → CastTo/Break FInventoryItem → Branch(ItemName==NewItem.Name) → True: Get → Modify Count → Array Set (replace at index) → return. If not found: Make FInventoryItem → Array Add. RemoveItem: Find by name → Branch(Count>1) → True: decrement → Set at index. Else: Array Remove at index. Key: Arrays of structs require 'Array Set' with index to modify in place — getting and modifying a copy does NOT update the array.