Ninja Bear Studio Plugins Help

Interaction Duration

Many interactions are hold-to-activate: the player must press a button for a set duration before the interaction actually occurs. The Interaction System supports this pattern with minimal changes to assets you've already created—no new gameplay concepts required.

  • Smart Object / Interaction Behavior
    Set a non-zero Duration on the interaction's behavior so the system treats it as hold-to-activate. (Leave at 0 for instant interactions.) See Interaction Targets.

  • State Tree
    Ensure the State Tree used by this interaction gates execution by duration (e.g., tracks progress, respects cancellation on release, and commits when the timer completes). This is the same tree referenced by your Smart Object slot configuration.

  • UI Widget (Prompt)
    In your prompt widget from User Interface and ViewModels, react to interaction state and optionally display progress (e.g., a ring/bar bound to a ViewModel field) during the hold window. The prompt should also hide/rollback cleanly on cancel.

Smart Object

Set a non-zero Duration on the interaction's Interaction Behavior to make it hold-to-activate. A value of 0 keeps the interaction instant.

Setting a Duration in the Smart Object

  1. Open the Smart Object previously created for the Interaction Target and navigate

  2. In the Interaction Behavior configuration, set Duration to 0.8 seconds.

Set Duration on the Interaction Behavior

State Tree

For the State Tree, we need to wait for the interaction’s Duration to complete before executing the behavior.

Waiting for the Duration in the State Tree

  1. Open the State Tree previously created and assigned to the Interaction Target.

  2. Add a new child state (e.g., Wait) directly under the Root, and add a Delay Task to it. Bind the task’s Duration to the value exposed by the Interaction State evaluator.

  3. In the Wait state, add a transition with an OnTick trigger to the next executable state (typically Execute Interaction). Add a Condition that checks: ElapsedTime (from the Interaction State evaluator) Greater or Equal Duration (from the same evaluator).

Wait state with Delay Task bound to Duration

Interaction Prompt

Now update the Interaction Prompt you added on the actor in the UMG ViewModels page.

Updating the Interaction Prompt on the Actor

  1. Add the Active Interaction ViewModel to the widget. Set Creation Type to Resolver and select the Interaction Resolver.

    Active Interaction VM with Resolver factory
  2. Add the Interaction Summary ViewModel to the widget. For this one, set Creation Type to Manual (it will use an instance provided by the Active Interaction ViewModel).

    Interaction Summary VM with Manual creation
  3. Add a Progress Bar (or equivalent progress indicator) to the widget. We'll configure the binding later.

    Progress Bar added to the prompt widget
  4. Update the Event Graph to hide the Progress Bar by default.

    Event Graph default hides the progress bar
  5. Update SetFocusState to also hide the Progress Bar when no focus is applied.

    SetFocusState hides the progress bar when idle
  6. Update SetInteractionState to also hide the Progress Bar when no interaction is in progress.

    SetInteractionState hides the progress bar when idle
  7. Create SetCurrentTarget. This function receives the current target actor, sets the active summary on the widget, and shows the Progress Bar.

    SetCurrentTarget updates the progress bar and bindings
  8. Add bindings so the widget reacts automatically:

    • ActiveInteraction.GetCurrentInteractionTargetSetCurrentTarget

    • InteractionSummary.GetElapsedTimePercentProgressBar.Percent

    Bindings for current target and elapsed percent
Last modified: 01 October 2025