Skip to content

UMageItCombatTextWidget

Base Class: UUserWidget

UMageItCombatTextWidget is the visual counterpart to the UMG renderer. It is a customized UMG widget designed to be pooled and reused by UMageItCombatTextRendererUMG: rather than spawning a new widget for every hit, repeated damage on the same target updates the same widget instance, accumulating the displayed value.

When creating custom combat text visuals in the Unreal Engine editor, your Blueprint widgets should inherit from this class to gain access to the built-in accumulation/fade-out logic and lifecycle events.


Blueprint Events (Blueprint Native Events)

Section titled “Blueprint Events (Blueprint Native Events)”
  • FadeIn (EventData: FMageItCombatTextEvent) Fired when the widget is first assigned to a target (no prior active widget existed for it). The default implementation sets Damage = EventData.DamageAmount and starts the fade-out timer.
  • UpdateDamage (EventData: FMageItCombatTextEvent) Fired when a new hit lands on a target that already owns this widget. The default implementation adds EventData.DamageAmount to Damage and restarts the fade-out timer — this is what makes rapid hits accumulate into one growing number instead of spawning duplicate widgets.
  • FadeOut Fired when the fade-out timer elapses with no further hits. The default implementation resets Damage to 0, sets visibility to Collapsed, and calls Renderer->ReturnWidgetToPool(this).

  • Damage (Float, BlueprintReadOnly): The current accumulated damage value. Bind a Text Block to this to display the number.
  • TargetActor (WeakObjectPtr<AActor>, BlueprintReadOnly): The actor this widget currently represents.
  • Renderer (WeakObjectPtr<UMageItCombatTextRendererUMG>, BlueprintReadOnly): The owning renderer instance, used to return the widget to its pool.
  • FadeOutDelay (Float, EditDefaultsOnly, BlueprintReadOnly): Seconds of inactivity after the last hit before FadeOut fires. Default 0.5.

Both FadeIn and UpdateDamage call a shared internal helper that sets the widget’s visibility to Visible and (re)starts a timer for FadeOutDelay seconds targeting OnAccumulationFinished, which calls FadeOut. Because every new hit restarts this timer, a target being damaged continuously keeps its number visible and growing for as long as hits keep landing, and only fades once damage stops for FadeOutDelay seconds.