Ninja Bear Studio Plugins Help

Configuring Player Vitals Widget

Player Vitals

ViewModels are instantiated and used by widgets and can even be configured to exchange data between themselves. You can find a complete list of ViewModels available in Ninja Combat, but here are a few common usage examples:

  • Setting player vital attributes, using progress bars or text.

  • Displaying damage applied to enemies, including accumulating damage applied over time.

  • Tracking active Status Effects from Gameplay Effects applied to the player or to enemies.

Configuring a Player Health Bar

  1. Create a widget with a progress bar that will be used to represent the player's health.

    Health Bar
  2. In the ViewModels tab, add the Vitals ViewModel to your widget and set its Creation Type to Resolver. Select the Ninja Combat ViewModel Resolver class.

    Vitals ViewModel
  3. In your widget Hierarchy panel, select the Progress Bar component. We will create a View Binding for it next.

  4. In the View Bindings panel, click Add Widget, select the percent property from your Progress Bar, and bind it to the Health Percent property, from the Combat Vitals ViewModel.

    Vitals Bindings

You can also use Conversion Functions to perform common conversions such as float to text. Unreal Engine already provides many of these functions.

Converting Current and Maximum Health

  1. In your Health Widget add Text Block components to represent the player's current and maximum health.

    Current and Maximum Health
  2. Create a View Binding for the Current Health, but using the To Text(Float) Conversion Function.

  3. Configure the conversion details, binding the Value to the Current Health property, from the Combat Vitals ViewModel.

    Conversion Functions
  4. Repeat the steps for the Maximum Health Text Block, binding it to the Max Health Total property, from the Combat Vitals ViewModel.

Enemy Vitals

The same structure can be used by widgets assigned to enemy blueprints. The difference is that you need to set the Combat Actor that will provide the Ability System Component and the Combat Manager used for bindings.

This can be done in two ways:

  1. Using the provided NinjaCombatWidgetComponent in your blueprint. It automatically sets the owner to any Combat Widgets hosted by it.

  2. Calling SetCombatActor, from the CombatActorAwareInterface on any Combat Widget that needs to know about the combatant actor.

For enemies, you can explore additional ViewModels and bindings to show or hide the widget as needed.

Additional Widget Bindings
03 July 2026