Ue5 - adding npc interactable objects dynamically

Hello @xionoodlebear,

Welcome to the Convai Developer Forum!

Thanks for your patience, and apologies for the delayed response. We’ve been experiencing some high volume recently.

There are two recommended ways to dynamically add objects like your cupcake actors to a Convai character’s environment at runtime:

Method 1: Using Class References

In your Convai NPC Blueprint:

  1. Use the Get Actor of Class node to find your spawned cupcake.
  2. Access the ConvaiChatbot component and get its Environment object.
  3. Use the AddObject function to register the cupcake with the environment.

Method 2: Using Tags

If you’re spawning multiple cupcakes dynamically:

  1. Add two tags to each spawned cupcake:
    • One common tag like Object
    • One unique tag like Cupcake
  2. Use Get All Actors with Tag to collect all cupcake instances.
  3. Loop through them and call AddObject for each.

This allows your NPC to recognize and interact with the cupcakes, even if they weren’t part of the original scene.

We’ve attached example screenshots to help visualize the Blueprint setup.