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.
20 results for health bar
Pattern: WBP_HealthBar with ProgressBar(HealthBar, BindWidget). Player BeginPlay: CreateWidget(WBP_HealthBar, PC) → SET WidgetRef → AddToViewport. On health change: WidgetRef → SetPercent(HealthBar, CurrentHealth/MaxHealth). Alternative: use property binding in widget designer for auto-update.
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.
Pattern: EventAnyDamage → Subtract_FloatFloat(A=CurrentHealth, B=Damage) → Clamp(Value=Result, Min=0, Max=MaxHealth) → SetVariable(Health=ClampResult) → Branch(Condition=(Health <= 0)) → True: call OnDeath custom event. Variables needed: Health (float), MaxHealth (float). EventAnyDamage output pin is 'Damage' (float). Clamp inputs: 'Value', 'Min', 'Max'. All floats.
Pattern: BeginPlay → CreateWidget(WidgetClass, GetPlayerController(0)) → store as variable → AddToViewport(Widget, ZOrder=0). Remove: RemoveFromParent(Widget). Toggle: SetVisibility(Collapsed/Visible). Create once, toggle visibility — never recreate every frame. For interaction: SetInputModeUIOnly + SetShowMouseCursor.
Bounds a value between Min and Max. Useful for clamping health to [0, MaxHealth] etc.
UProgressBar::SetPercent. 0.0 to 1.0 range.
Set PercentUE 5.0, 5.1, 5.2, 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.
InPercent: 0.0=empty, 1.0=full. Use Divide to convert (CurrentHealth/MaxHealth).
SetPercentUE 5.3, 5.4, 5.5, 5.6, 5.7updated 2mo ago