x

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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Restart a level at checkpoint reached

Hey guys, I'm working with a mechanic that requires all instances of a certain actor blueprint to be reset once the player leaves the room. The current setup I have is to reset the level once the player touches a checkpoint. I've tried using ResetLevel, but it deletes the player character. I've also tried OpenLevel but that puts the player back at the start.

Is there a way to reset a level but keep the player at the checkpoint location, or is there a better way to go about this that I'm missing?

Product Version: UE 4.18
Tags:
more ▼

asked Feb 14 '18 at 10:35 AM in Blueprint Scripting

avatar image

Airis_
1 1 4

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

2 answers: sort voted first

One approach is to use a custom GameInstance. The GameInstance is persisted between level loading so you can use that to store a reference to the checkpoint you want to spawn at.

The next part is to implement the necessary logic so that when your level loads it will fetch and use that reference to spawn the character. Don't forget to set a default checkpoint for when the level is loaded for the first time.

more ▼

answered Feb 14 '18 at 12:51 PM

avatar image

Wobbleyheadedbob
68 6 9 8

avatar image Wobbleyheadedbob Feb 14 '18 at 12:55 PM

Another approach would be to use the SaveGame object to save the necessary spawn location to file and then load it up when your map starts. This would persist your current checkpoint beyond a single play session.

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

You could also use a streaming level and make sure your checkpoint floor is part of your persistent level you then unload the streaming level and reload it.

You have your main persistent map which you load the streaming level into. then when you want to reset it unload and reload the streaming level.

this means the level around the player would disappear and reappear. so in your persistent level where you trigger the reset you'll have to have something for the player to stand on while this occurs or they will fall to there doom.

this will keep your player but reset the level in a seance.

more ▼

answered Feb 14 '18 at 03:29 PM

avatar image

Exonfluxx
379 1 5 8

(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