I created an ingame menu with UMG. Now I’ve got continue and quit working. But restart is the issue. I want restart to actually reset (reload) the level, so no respawn scripts that just put my character back at a certain point.
Basically I want the “open level” node to recognize my “current level” name. All my levels are called “Level1/2/3/4etc.”
You could try saving the current level name to a savegame variable, then make an empty map that does nothing but load levels. Load that empty map and on begin play, make it load a level and pass the level name into it. Then it will automatically load that level.
Look into the savegame class. Basically you create a new blueprint with the savegame class and put variables in there you want to save between levels. Then you can call functions that save and load variables to and from the savegame class instance you created for your game. Create a variable that holds the level name you want to load (as a string or name) and when you click “restart”, you tell the savegame to save the current level’s name to that savegame variable. Then you load this new map I mentioned earlier, just an empty map. Its level blueprint would, on Event Begin Play, load the string level name from the savegame blueprint and then load a level, the name of which would be that level name variable you just loaded. This would essentially restart the current level by loading another map quickly then loading the current level again.