Skip to content

UMageItCombatTextRendererUMG

Base Class: UMageItCombatTextRendererBase Interfaces: FTickableGameObject

UMageItCombatTextRendererUMG renders combat text as pooled UMageItCombatTextWidget instances placed directly in the viewport. It is the most flexible renderer — full UMG animation, easy per-widget Blueprint logic — at the cost of one pooled widget per concurrent on-screen number.

Its defining feature is damage accumulation: repeated hits on the same TargetActor update the same widget instead of spawning a new one, growing the displayed number and resetting its fade-out timer.


  • PoolSize (Integer, EditDefaultsOnly, min 1): Number of widgets pre-allocated at Initialize. Default 10.
  • MaxPoolSize (Integer, EditDefaultsOnly, min 0): Hard ceiling on total widget count (including the initial PoolSize) the pool may grow to when exhausted, instead of dropping the damage event. 0 = unbounded growth. Values below PoolSize have no effect.
  • LocationInterpSpeed (Float, EditDefaultsOnly): Interpolation speed used to smoothly move a widget’s tracked world position towards its target. Default 15.0.
  • bTrackActorLocation (Boolean, EditDefaultsOnly): Whether the widget follows its TargetActor as it moves after spawning.
  • bUpdateLocation (Boolean, EditDefaultsOnly): Whether new damage events on an already-active target update its tracked position.
  • bSmoothLocationUpdate (Boolean, EditDefaultsOnly): When a new event updates the position, whether to interpolate towards it (true) or snap immediately (false).
  • ScreenLocationOffset (Vector2D, EditDefaultsOnly): Constant pixel offset applied to the final projected screen position.
  • WidgetClass (TSubclassOf<UMageItCombatTextWidget>, EditDefaultsOnly): The widget class instantiated for the pool.
  • WidgetPool (Array<UMageItCombatTextWidget*>): Widgets available for reuse.
  • ActiveWidgets (Map<WeakObjectPtr<AActor>, FMageItWidgetTrackingData>): Widgets currently assigned to a target actor. See FMageItWidgetTrackingData.

void ReturnWidgetToPool(UMageItCombatTextWidget* Widget);

(Blueprint Callable) Pushes Widget back onto WidgetPool and removes it from ActiveWidgets — but only if Widget is still the one tracked as active for its TargetActor. This guards against a stale call (e.g. a FadeOut timer that outlived a pool reset) returning the same widget to the pool twice. Called automatically by UMageItCombatTextWidget::FadeOut — you normally don’t call this directly.


Calls the internal EnsurePool(), which resolves the local player’s PlayerController and, since the pool hasn’t been built for it yet, pre-allocates and hides PoolSize widgets — adding each to the viewport (Collapsed visibility, centered alignment) so later reuse doesn’t pay CreateWidget cost.

Note: The renderer instance outlives level travel, but the PlayerController and the widgets built against it don’t. EnsurePool() remembers which controller its current pool belongs to and, if RenderDamage or Tick ever sees a different (or newly re-resolved) controller, tears the old pool down and rebuilds it from scratch — so you don’t need to re-register this renderer after a level transition.

First resolves the target actor from EventData.TargetActor, falling back to EventData.HitInfo.GetActor(). If neither is present, logs a Warning and drops the event — this renderer has no concept of a damage number that doesn’t track an actor. Then calls EnsurePool() (covering the level-travel case above) and only continues if the pool is ready:

  • If the actor already has an active widget, calls UpdateDamage on it (accumulation) and updates its tracked target position according to bUpdateLocation / bSmoothLocationUpdate.
  • Otherwise, pulls a widget from the pool (or grows the pool if under MaxPoolSize) via the internal UseWidget, sets its initial position, and calls FadeIn.
  • If the pool is exhausted and can’t grow, logs a Warning and drops the event.

Re-resolves PlayerController (see the level-travel note above) and returns early if there’s still none, or if ActiveWidgets is empty. Otherwise, for every active widget: optionally accumulates the target actor’s movement delta into a target position (bTrackActorLocation), interpolates the widget’s current world position towards it (LocationInterpSpeed), projects that position to screen space via PlayerController->ProjectWorldLocationToScreen, and calls SetPositionInViewport (plus ScreenLocationOffset). Gated overall by IsTickable/CanTick, so it stops running entirely once Shutdown has been called.

Empties ActiveWidgets, removes every pooled widget from the viewport, and forgets the controller the pool was built for, before calling the parent implementation (which marks the renderer as shut down — see UMageItCombatTextRendererBase).