I’m trying to create a pause for my game…I’d like mouse to come up so I can have some click events…How can I achieve this with Blueprints?? I’m using first person template.
thank you.
I’m trying to create a pause for my game…I’d like mouse to come up so I can have some click events…How can I achieve this with Blueprints?? I’m using first person template.
thank you.
Hey AttemptD,
Showing Mouse Cursor is a Bool variable in Player Controller class. You can set this fairly easily by using Get Player Controller node, then dragging off of that and searching for Show Mouse Cursor node. Set this up after your pause function and you can enable/disable cursor during pause state.
Hope that helps!
This was very helpful thank you!! But is there a secret to getting NoClicked Events work then?? I have it on a mesh I created in a BP. When I press P it pulls up a floating menu and cursor…i have a chain of events that will work usually but not if i need to click on mesh with cursor…is there something i don’t know??
There shouldn’t be anything preventing an OnClick event from working. If you show me an image of your menu mesh blueprint, I might be able to spot something that’s not working.
Old thread, but this is still very relevant. I’ve combined a few solutions to come up something that works well for me:
First, swap the controls: This uses the Enhanced Input Subsystem (otherwise, you’ll have to use something like Disable Input). We swap between the default controls and a new set of controls made just for the pause menu by adding/removing input mapping contexts. This allows us to leverage the same IA_PauseMenu
event (see the image at the bottom), meaning we can set our input mapping contexts to show & hide the menu with the same key.
Second, handle showing the mouse: We show/hide the mouse cursor, then we do some other config magic to ensure that there aren’t any focus issues that commonly happen here. I got these nodes from this video, which was extremely helpful in understanding why they’re needed here. NOTE: Using Shift/Tab to toggle the menu may also cause focus issues. Either use a different key or try this solution.
Last, set the UI’s visibility: We can now simply show the menu by setting the widget’s visibility to visible
. When setting the menu to visible, I also borrowed some logic from here that centers the mouse cursor for you.
I have this function directly in my player controller, which I call like this: