Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

What is the easiest way to load the level which player is in ?

Hi. I'm making a level based game but im stuck at how should i get the level player was in before exiting the game. I got a main menu which has a "Play" button but i dont know how to make that button load the level player was in before exiting the game.

Product Version: UE 4.21
more ▼

asked Mar 24 '19 at 10:26 AM in Blueprint Scripting

avatar image

8 3 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi, The easiest way would be that you save the name/number of the level the player was last in. On opening the game load the savegame and display a button with continue or so on it. Based on the variable name or number the specific level should be started.

more ▼

answered Mar 24 '19 at 11:06 AM

avatar image

1.4k 9 5 10

avatar image AmazingChicken Mar 24 '19 at 03:46 PM

i tried but i got confused. can someone explain me how to do that ?

avatar image lkav Mar 27 '19 at 02:54 PM

first, Setup: create a savegame blueprint (there is a savegame blueprint type) open it and create a new variable either string (for name) or integer (for number) type.

Logic: (inside your Player Controller for example) check image, make sure you give the slot a name and execute this logic on start up / begin play image

Saving a Variable to a slot alt text

answerhub.png (95.5 kB)
answerhub2.png (59.4 kB)
avatar image AmazingChicken Mar 27 '19 at 08:14 PM

sorry i didnt understand, should i use the first image on my play button ? i'm still confused. i got an actor bp in end of each level which ends the level and creates a widget to move on next level. should i use that actor for saving game to slot ?

avatar image lkav Mar 27 '19 at 09:21 PM

You need to set up first a save game Blueprint with the variable you want to save. Inside your Player Controller for example use the first image logic on begin play. To load/create the savegame.

The second image is how you store/save variables

(there are a lot of good Tutorials out there for Savegames like this: Video)

avatar image AmazingChicken Mar 30 '19 at 08:01 AM

i was finally able to do it. thanks.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question