How can I edit a variable in a character class from another blueprint?

I am trying to create a dialogue system with choices that the player selects via a widget. The widget has two buttons which I want to change a variable in another class. I am not sure why I keep getting an error.

For some reason, the widget blueprint is not able to read the reference to the other blueprint. Here is the other blueprint.

Could someone please tell me why I am getting a “Accessed Non trying to read property REF_NPC” error message?

It’s because you’ve made your variable REF_NPC, but you haven’t assigned it.

I don’t know how many NPCs you have, but you could set the variable using GetActorOfClass, and use the class of your NPC.

Thank you! I was struggling with this for hours.

1 Like