Input and Interaction: Start and Cancel an Interaction
Let a player search a crate and stop the search by releasing Interact. Ninja Input reads the button. Ninja Interaction reserves the slot, counts the time, and reports whether the search finished. Start with a working Input Setup and a focused interaction target.
Start on Press and Let the Tree Count
Route press and release to the current pawn
Set up a tree-timed search. Map a Boolean IA_Interact action with no explicit triggers. Add a custom Ninja Input Handler to the active Input Setup, assign the action, and select Started and Completed.
In Handle Started Event, call
GetPawnon the supplied Input Manager, thenGetInteractionManagerComponentfor that pawn. Remember the focused search summary's ID on the pawn. CallTryInitializeInteractionWithCurrentTargetwith the offered search type, such asInteraction.Type.Search.In Handle Completed Event, use
GetActiveInteractionSummary. If the ID matches this press and the search is still waiting to commit, callTryCancelCurrentInteractionwithInteraction.Event.CancelledButtonPress. Clear the saved ID. For a press-and-wait search, let the tree finish after release.
In a C++ input handler, the corresponding overrides are HandleStartedEvent_Implementation and HandleCompletedEvent_Implementation. Keep the selection on the player or pawn so two players using the same handler have independent searches.
Confirm After an Input Hold
For a switch that should stay available to others while the first player holds a button, use an immediate slot with a one-shot Hold trigger. On Started, save the focused summary ID. On Triggered, take and clear that ID and call TryInitializeInteractionBySummaryId once. Clear it on Canceled, loss of focus, or unregistration. Blueprint can bind OnFocusStateChanged on the manager. C++ can subscribe to Native_OnFocusStateChanged and remove the binding when the prompt closes. Confirm an Interaction with a Hold Input Action includes the progress bar.
Block Movement During the Interaction
For a search animation that takes control of movement or facing, grant Input.Block.Movement or Input.Block.Rotation through its Gameplay Effect during playback. The corresponding Ninja Input handlers honor those tags. Animate an Interaction covers the effect and animation setup.
Try It in Play
Release halfway through the crate search. The reserved slot should become available and the search should yield nothing. On the input-timed switch, release early and check that the interaction never starts. Then start holding on switch A and turn toward switch B. Neither should activate until a fresh press. If B activates, check that confirmation uses the saved ID.