Character actions examples
End-to-end action recipes for navigating to a registered object, following a character, and using parameterized actions in the Convai Unreal Engine plugin.
Each example below is self-contained: it lists the Details panel configuration and the Blueprint handler pseudocode needed to implement a working action. Start with Example 1 if you are new to character actions. The examples progress from default navigation to custom actions with typed parameters.
Example 1: Navigate to a registered object
Scenario: A training-simulation instructor NPC navigates to a piece of equipment when the trainee asks it to go there.
Configuration
In the NPC Actor's Details panel, under Convai Chatbot > Environment:
Enable Actions is ticked.
Actionsarray contains aMove Toentry with adestinationparameter of type Actor Reference (this is the default).Objectsarray contains an entry:Name:"SafetyValve"Ref: the valve Actor in the levelObject Is:Whole ActorAcceptanceRadius:100.0
Blueprint handler — Move To
Add a Custom Event named Move To to the NPC Actor Blueprint with one FConvaiResultAction input:
// Blueprint pseudocode
Event Move To(ActionData: FConvaiResultAction)
// Read the destination object reference
DestEntry = GetParamAsRef(ActionData, "destination")
// Resolve the entry to AI Move To inputs
ResolveGoalLocation(
Entry = DestEntry,
SourceActor = Self,
// outputs:
TargetActor, ObjectActor, ObjectComponent, Destination,
OutAcceptanceRadius, bUsesDestination,
bSuccess, bAlreadyThere, bReachable, PathEnd, PathPoints,
GoalTravelDistance, MovementPointIndex
)
if not bSuccess:
AbortActionSequence(
EventText = "Destination actor no longer exists",
ShouldRespond = Always
)
return
if bAlreadyThere:
HandleActionCompletion(IsSuccessful = true)
return
// Wire both pins straight into one AI Move To — no branch needed.
// Target Actor is null exactly when Destination should win.
AIMoveTo(Target = TargetActor, Destination = Destination, AcceptanceRadius = OutAcceptanceRadius)
// Wait for AIMoveTo to complete via OnMoveCompleted
// Then call:
HandleActionCompletion(IsSuccessful = true)The Convai Move To async node wraps this same resolution and issues the move internally — see Actions Blueprint reference for a simpler alternative to wiring Resolve Goal Location and AI Move To by hand.
Example 2: Follow a character
Scenario: A security-training NPC follows the player on a patrol route until told to stop.
Configuration
Actionsarray containsFollow(name:"Follow", parameter:character, type Actor Reference) andStop Moving(name:"Stop Moving", no parameters) — both are defaults.Charactersarray contains:Name:"Player"or matches the player'sPlayerNamefield on theConvai Playercomponent.Ref: the player pawn Actor.
Blueprint handler — Follow
Blueprint handler — Stop Moving
The event name must match the registered action name, including spaces. Because the default action is registered as "Stop Moving" (with a space), the Blueprint Custom Event must also be named Stop Moving — not StopMoving.
Follow starts an ongoing behavior, but the action itself should complete after the follow loop starts. This lets later actions, including Stop Moving, dispatch normally.
Example 3: Parameterized action with a string choice
Scenario: A medical-simulation NPC administers a treatment chosen from a fixed list when instructed.
Configuration
Add a custom action to the Actions array:
Name:"Administer Treatment"Description:"Administer a specific treatment to the patient"Parameters:
Name:"treatment"Type:StringChoices:["CPR", "Defibrillation", "IV Fluids", "Oxygen Mask"]
Blueprint handler
Example 4: Parameterized action with an enum
Scenario: A corporate-onboarding NPC changes its posture based on a command.
Configuration
Assume an existing UENUM named ENPCPosture with values Standing, Sitting, Crouching.
Add a custom action:
Name:"Change Posture"Parameters:
Name:"posture"Type:EnumEnumType:ENPCPosture
Blueprint handler
Example 5: Print with a dynamic string parameter
Scenario: A training NPC prints Convai-supplied text to the screen when asked.
Configuration
Add a custom action to the Actions array:
Name:"Print"Parameters:
Name:"text"Type:StringDescription: leave empty or use a short hint
Compile the Blueprint, then scaffold the handler with Create Convai Action Handler.
Blueprint handler
Test prompt: "Print your name on the screen."
Example 6: Dance with Choices and a fallback
Scenario: A character plays one of several dance montages from a single action.
Configuration
Create an
Anim Montagefor each dance style. Tune blend in/out on each montage.Add action
Dancewith one parameter:Name:"type"Type:StringChoices:["groove", "disco", "g-style"]
Blueprint handler
Test prompts: "Show me the groove dance." (plays montage), "Do the ballet dance." (fallback branch — character explains the style is unavailable).
Example 7: Start a sequence after speech begins
Scenario: A safety-drill NPC gestures toward an exit sign after its spoken warning begins, then walks to the sign.
Configuration
Two actions in the Actions array:
Announce— custom action, no parameters,bWaitForBotSpeech = true,DelayAfterBotSpeechSec = 0.5.Move To(default) —bWaitForBotSpeech = false.
When Convai generates the response "Announce, Move To ExitSign" while the action queue is empty, the plugin:
Receives
Announceas the first action in the new sequence.Because
AnnouncehasbWaitForBotSpeech = true, waits until the character's speech begins, speech finishes, the no-response path fires, or the action wait timeout expires.Fires
Announceafter the wait condition resolves plus0.5seconds.Advances to
Move Toafter theAnnouncehandler callsHandleActionCompletion(true).
Blueprint handler — Announce
Next steps
Parameterized actionsActions Blueprint referenceTroubleshoot character actionsLast updated
Was this helpful?