Set input mode game and UI and control character camera

Where do you create the widget, inside the player or the npc? The error you’re receiving means that your variable is not set or the reference is invalid.
If you create it inside the npc, make sure to give the reference of the created widget to the player, and use that reference to target the events. You could use either a callback, to give said reference to the created widget back to the player, if the message is an event on the npc, or the return node if is a function.