How to pass a boolean between a "ThirdPersonCharacterBP" and a widget blueprint?

Ik, novice question. But…

I’m trying to create a basic pause menu, I’ve followed the tutorial found in the engine documents, but it’s not exactly what I want. So I botched together a function in the “ThirdPersonCharacterBP” blueprint which gets called when I hit “ESC” on the keyboard.

Hopefully you can make sense of that^.

The setting of the boolean to true (at the end) is to stop the user from repeatedly pushing “ESC” and creating the “PauseMenu” widget layer upon layer.

This all works fine. Perfectly. Too perfectly.

The above widget blueprint also works fine. You can hit “ESC” whilst playing and it’ll pause, bring the pause menu up and you’re able to interact with it correctly.

Now this is the tricky bit. From within this widget, preferably following on at the end, I would like to set the boolean “PauseMenuActive” back to false. So that I can open it again, because at the moment all I get is one use of it, I hit resume followed by “ESC” to find that the program still thinks that the pause menu is active.

TL;DR
Above blueprints work fine, but I want to change the “PauseMenuActive” boolean back to false when I resume gameplay. And yes, it is a public variable.

I don’t know if there is a clean way, but you can do it via event dispatcher

Hey Piccadi,

What you’re looking for is casting. You can use this to communicate in cases such as this.

Cast the player’s character to your character blueprint (It says first person in my screenshot, but you would cast to your third person character instead). Then use that character reference to access the variable you want to change.

Cheers Mookiez. Works like a charm.

I don’t know enough about casting yet for me to consider it. I should probably put some effort into learning about it now.