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.
26 results for persistence
UGameplayStatics::GetGameInstance. Persists across level loads.
Get Game InstanceUE 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoSETUP: Create Blueprint inheriting UGameInstanceSubsystem (or UWorldSubsystem for level-scoped). Override Initialize(Collection) to set up. Override Deinitialize to clean up. Add game variables here (Score, PlayTime, Settings). ACCESS FROM ANYWHERE: GetGameInstance → GetSubsystem(BP_GameSubsystem) → CastTo<BP_GameSubsystem> → access variables. WHY: Subsystems auto-create, auto-destroy, and don't need FindActor. Better than GameInstance for well-organized systems. UGameInstanceSubsystem persists across levels. UWorldSubsystem is recreated each level.
Pure node. Ideal for storing data that persists across level loads.
GetGameInstanceUE 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoSpawn Sound at LocationUE 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoA class for persisting player progress to disk. Subclass USaveGame, add fields, then SaveGameToSlot / LoadGameFromSlot.
FlushPersistentDebugLinesUE 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoDealing damage: Event → ApplyDamage(TargetActor, BaseDamage, InstigatorController, DamageCauser, DamageTypeClass). Receiving: EventAnyDamage → Damage output → Subtract_FloatFloat(CurrentHealth, Damage) → FClamp(Result, 0, MaxHealth) → SET CurrentHealth → Branch(CurrentHealth <= 0) → True: DestroyActor. Initialize CurrentHealth=MaxHealth in BeginPlay.
Pattern: Variables RegenRate(float)=5.0, RegenDelay(float)=3.0, RegenTimerHandle. On damage received: ClearTimer(RegenTimerHandle) → SET timer(RegenDelay, RegenTick, looping=true). RegenTick function: Branch(Health < MaxHealth) → True: SET Health = FClamp(Health + RegenRate*DeltaSeconds, 0, MaxHealth). False: ClearTimer.
0 = live forever.
Set Life SpanUE 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo agoPattern: BP_Checkpoint with BoxTrigger, variable CheckpointID(int). OnBeginOverlap(Player) → DoOnce → CreateSaveGameObject(MySaveGame) → SET PlayerLocation, Health, Inventory, CheckpointID → SaveGameToSlot('AutoSave', 0). On death/respawn: LoadGameFromSlot('AutoSave') → Cast → TeleportTo(SavedLocation) → restore Health etc. Show 'Checkpoint Reached' UI briefly.