Whenever I pause my game everything works as it should be, but my slider seems to reset when pause to zero. Any Ideas. Thanks
I’m guessing that your slider widget is being created again after you press the pause screen. It would be better if you store the slider value in some other class, like the game state or player character everytime the slider value is changed. Whenever you are removing the widget and creating again, you can retrieve the value from this outside class and set the corresponding value in the widget.
Hi Stormrage,
How do I do that?
Let’s say you’re having a slider that goes down from 100 to 0 by 1 unit everytime you press the left mouse button. So in this case, everytime you do that, after changing the slider values, you use ‘get player character’, cast to your character and store the slider value in some variable there.
Now everytime you are adding the slider widget to viewport, you take this stored value from character and update the slider value accordingly.
If you want an example, I have uploaded a git hub project where I’m updating the slider value using this method so that it remains the same even if you go to another level and come back: GitHub - RohitKotiveetil/UnrealEngine--PrototypeMenuSystem: Main Menu System created using blueprints in Unreal Engine. Status: Work-in-progress.
Thanks for that I shall have a look at your UMGMenuSystem.
Hi Storm, I do like the way you setup your system. On LoadGameLevel (PrototypeLevel_Map) I swap it with a custom MAP as a test. But for some reason it doesn’t load. I thought. Cheers
Where did you make this change? There is an event in the ‘Game Instance’ class to open new level. Changing the map name in there should work. If it still isn’t, trying giving the complete location of the map in your content folder using something like this. [content/maps/map_abc]
NB: Screenshot
I don’t know why is still not picking up loadGameLevel
I don’t think the screenshot was uploaded. Can’t see it from my end.
I test your system with MainMenu_Map, PrototypeLevel_Map, Custom Test Map I created. None of those load in game. I bypass the loading screen (Set State) that seems to open the level fine. But then when P is press you don’t get menu back.
The code for pressing P is in my player controller blueprint. If you have a custom level and a custom player controller, I suggest you try moving that code into your own player controller. The code for the same is quite small, so it should be easy to transfer.
I’m working on a new update that slightly changes how some of the functionalities including the working of pause menu. It’ll most probably be updated today or tomorrow in the git hub. It will rectify some of the bugs that I’ve found while working with the pause menu.