Hi everyone,
I’m working on a dialogue system using Blueprints in Unreal Engine, and I have a question about communication between a UI Widget and NPC actors via a Blueprint Interface.
Here’s the situation:
- I have a Widget Blueprint that contains buttons.
- When a button is clicked, I want to send a notification to an NPC using a Blueprint Interface function (e.g.,
StartDialogue
). - I’m avoiding using
Get All Actors of Class
orCast To
for performance reasons. - I understand that I need to set a reference to the target NPC in the widget, but I’m not sure what the best way is.
Currently, if I manually assign a specific NPC reference to the widget (like by name), then all duplicated widgets will send the message to the same NPC, which is not what I want.
What I want is:
When a widget is created for a specific NPC, it should only communicate with that one instance of the NPC.
My question is:
What should I set as the target reference in the Widget so that each widget talks to only one, specific NPC instance—without using
Get All Actors
or hardcoded names?
Any best practices or clean solutions for this kind of setup?
Thanks in advance!