Variable that communicates with a Character and the Level

Hey! I’m now starting to learn how to use Unreal Engine. I want to be able to perform a certain action when the game is in a certain state. For example, when I press E, I want the game to stop and be able to control my mouse around. The path I took to make this is to create a widget when I press E. I watched a couple of tutorials and from what I’ve seen, the widget needs to be created on the level blueprint. This is what I have:

Now, I want to be able to check, in the character blueprint, if the widget is on the viewport or not. If so, I want to control my mouse freely, if not, just ignore it. I thought the best way to check was through a variable, but I can’t find a way to create a boolean in the level blueprint and then check if it was true or false on the character blueprint. Any thoughts?

Thank you!

When you put the widget up, use

and when you exit

image

2 Likes