Restart level issue

Alright, so I am new to using UE. I am currently on 4.10.3, and using the FirstPersonShooter example level as my basis for testing and learning. I went to add a pause/reset/exit menu, and resume and exit work perfectly fine. However, reset will either crash my game or the entire editor. This is the current setup I have, the one that only crashes the game and not the editor itself. Remove Prefix String is unchecked because with it checked, CTD. Any assistance would be appreciated. I forgot to add, the errors given after the crash is “TravelFailure: InvalidURL, Reason for Failure: ‘Invalid URL:/Game/FirstPersonBP/Maps/FirstPersonExampleMap’” as well as “TravelFailure: ClientTravelFailure, Reason for Failure: ‘Invalid URL:/Game/FirstPersonBP/Maps/FirstPersonExampleMap’”

Edit: It seems when the game is packaged, it properly restarts the level, but you have no control over the player and no inputs are accepted.

use the blueprint script “execute console command” and type RestartLevel in the text box.

That CTDs me. That was the first method I tried. It just can’t find any of the levels through blueprint scripts and I don’t know why.

Well darn. Hopefully a hotfix will fix this. Or they’ll include it in 4.11, whichever comes first.

probably this bug:
Load Level Bug

Hi everyone,

Please try the 4.10.4 hotfix to see if this addresses your error. If not, please post back here and I’ll be happy to look into this further.

seems ok now. thanks for the quick hotfix!

Well, RestartLevel in an Execute Console Command node restarts the level, but you cannot control the character after the restart. Get Current Level Name > Open Level still crashes me with the same error as before.

Can you post the crash logs and callstack here? If possible, do you have a project where this is occurring that you can provide so I can take a look?

I have logs from each different setup I had. Get Current Level Name > Open Level doesn’t crash me anymore for some reason. What do you mean by callstack? link text

The callstack is the text from the window that appears after a crash has occurred. It will look like this:

Additionally, can you post what steps you are taking to reproduce this crash on your end? The most exact the better so we can quickly reproduce this error.

Are you making sure to possess your character at level start? Do you have anything that could be preventing the movement from occurring, such as bool checks not being reset, etc. that may be tied to this?

Ohhh. As I said, none of them crash me anymore thankfully. The issue now is that the player cannot be controlled after the map is reset.

Well, this is what I had for repossessing the FirstPersonCharacter. I thought it would’ve worked, but apparently not. Do I have to have this strung into the reset button blueprint, or is it supposed to be in the level blueprint?

It may simply be spawning the player character after this is being run. Try putting a delay between the begin play and the possess. Do you see a difference?

Nope. Put a 2, 5, and then 10 second delay, didn’t do anything. It was all processing, because I was watching the event graph and everything was connecting and flowing. But still no control.

Try unpossessing the original pawn before the restart level occurs, then possess the new pawn when it is spawned. I’d recommend moving the possession mechanic to the player controller as opposed to the level blueprint to see if this helps.

Should I do this ((unpossess)) off an EndPlay event in the FirstPersonCharacter or as a part of the reset button in the pause menu?

I would unpossess off of the reset or on the death event of the player. Effectively you want to remove the player controller from the pawn that is to be removed so that you can possess the new pawn when the level is recreated. What you may wish to do is do an isValid check to ensure the controller still has a pawn before unpossessing, to prevent any unnecessary errors from occurring.

Guys this isnt a bug, for some reason restarting the level doesn’t reset the player controller so when you killed the input for death it is still active. Behavior is still the same in 4.12.3 just had a run in with this issue.