So I am having some problems I was able to put together a simple save and load system that stores the users location
The user can hit G to save the game and K to load the game
But I want to hook the save and load function’s up to UMG Buttons
The Save button is in the pause menu which can be bought up in-game by the user when they hit 0, while the load button is on the main menu which is separate from the player level
Right now I have all the save and load functions inside the Character Blueprint in my case it is called Gemini,
You should copypaste your code in a function library so you can call it when you want using the specific node.
For example, instead of build your code in your char’s BP you can create a new function library called “Banana”, create a new function called “Peach” with your save code and an other function called “Berry” with your load code. If you do this (as you can imagine the names aren’t important) you can call Peach and Berry functions where you want in your project. OFC you have to get a transform variable in input for saving and a transform variable in output for loading (for correct data transfert).
Sorry for my english, I hope I was clear! If it didn’t help you make me know, I’ll try to be more specific.
I’m sorry I am still very new to unreal engine 4 so I am not to sure how to do what you suggested, Im not even sure I know how to create function library is there any way you could provide some examples ?
Create Blueprint Widget, drag in a button for Save and a button for Load. Click on each button and in the Details panel on the right, scroll to the very bottom and select OnClicked or OnPressed. (OnClicked is fine for PC, OnPressed is fine for mobile device).
Then go to the Graph of the Widget once all buttons have been added and the red Events OnClicked/OnPressed have been added to the Graph.
Copy your save sequence of nodes and attach it to the OnClicked(Button for Save).
Do the same with load sequence of nodes and attach that to OnClicked(Button for Load).
Then in the level blueprint of whatever level you want to have those buttons available to be presed to save and load, connect these nodes in sequence to an EventBeginPlay(Will display the buttons to be pressed right on level startup):
CreateWidget (In Class select the Widget name that holds those buttons and the sequence of nodes that are inside the graph of that widget) —> AddToViewPort (Connect return value to target) —> SetShowMouseCursor and connect a GetPlayerController (return value to target)
Then instead of a function, I use a Custom Event. I create a Custom Event Save and Load inside my widget blueprint and inside my level blueprint I can call that event to save and load, once the buttons are pressed.
Thanks for the screenshots but I dont think this is what I am looking for I just want to let the user press the two UMG buttons I have made to save or load the game
Is pretty complicated if you are new to the engine, I’m really tired. If you can wait tomorrow I’ll reply with a pretty exhaustive explanation via answerhub or youtube video.
Create Blueprint, search for the term Game Instance and select that. It is a very clean way of saving all variables that should be kept like using variables in widgets and transferring the values to level blueprints.