How do I enable a variable that is "Set" in a widget blueprint to be accessed by a FirstPersonCharacter blueprint?

I have a button labeled “Spell” that’s added to the viewport on beginplay. I only want projectiles to be spawned when the button is “Active”. So, upon clicking on the “Spell” button, wherever the user clicks next on the screen spawns a projectile. The main problem is that I want the variable “Active” to be called by the FirstPersonCharacter blueprint and the only way that the variable is set to “true” is when the spell button is clicked. Any help would be greatly appreciated! Thank you!

Well two simple options would be:

  1. Inside the Widget blueprint when On Clicked is called, use Get Player Controller → Get Controlled Pawn → Cast to your player controller class → and call a function in the FirstPersonCharacter blueprint to spawn the projectile

  2. Store the widget in the FirstPersonCharacter blueprint as a variable, create a variable in the widget to store the FirstPersonCharacter blueprint, and set the character reference in the widget with the constructor or begin play. Then when On Clicked is called, call a function using the reference to the character inside the widget.