Node to call a function from a widget

Hello everyone, I ran into a problem, I don’t understand which node to attach to a key on the keyboard. In the widget, I created an animated game menu, when you press a key, the pause menu should appear. I created a function in the widget to show the menu, as I understand it, in the Level Blueprint you need to register the desired key and call the function that would show the pause menu, but how to do it?


Just click and drug from “As BP Game Instance” and find the function name in the list of proposed stuff

2 Likes

The fact is that I need to call the animated menu, i.e. I don’t understand where I should create a function to call Level Brueprints.

Where did you create the widget?

The pause menu widget is animated, in the pause widget in Graph I did not add functions


The Show Pause Menu feature is located in the GammaInstance.

@Yaklakootmaa2’s first answer was spot on, actually.

Drag a wire from here and search.


Do not disable context sensitive search and avoid placing isolated nodes in the graph. Use a wire first.

2 Likes

Thank you very much for your help, your advice helped! :handshake:


1 Like

The whole logic of the menu buttons, as I understand it, you need to prescribe grooves in the menu widget, for example?

Absolutely no idea what that means. Can you simplify it?

For example, I have another menu with an animation of appearing on the screen, I wrote the logic in the widget, for me I write the pauses in the logic in GameInstance, because the widget cannot call input key nodes from the keyboard, so I decided to write all the logic for me pauses in Game Instance. Can’t animation nodes for the appearance of me be added to the GameInstance Class or do I need to make a link to the pause menu widget again and prescribe functions in the widget itself in the Graph?

Yes they can and often should. You override onKeyDown in the widget once it has focus. Once the menu is up and you’re interacting with it, it should be responsible for handling player input in most cases.

Can’t animation nodes for the appearance of me be added to the GameInstance Class or do I need to make a link to the pause menu widget again and prescribe functions in the widget itself in the Graph?

Completely up to you:

  • you can call widget animation from the level blueprint
  • you can call it in the game instance
  • or you can call it in the widget
  • or the widget can call it for itself without getting LB or GI involved
1 Like