4.5.1: Slate loading screen crash / focus issue

Mouse focus is broken after showing a slate loading screen in 4.5. After level load the mouse focus still seems to be on the loading screen until the player clicks a mouse button to focus the game again.

My workaround for now is to call “Set Input Mode Game Only” on begin play in the character blueprint. However calling “Set Input Mode Game Only” in BeginPlay event crashes the game then. So I had to add a delay before calling it which is not ideal and should be fixed if possible too.

Version: 4.5 or 4.5.1


How to reproduce (issue #1):

  • Create new first person game project

  • Add a C++ blueprint function library and add a level loading screen function which is exposed to blueprint. For that you need to modify the Build.cs and include movie player header:

    // Build.cs
    PrivateDependencyModuleNames.AddRange(new string[] { “MoviePlayer” });

    // MyBlueprintFunctionLibrary.h
    UFUNCTION(BlueprintCallable, Category = “Game|Cinematic”)
    static void ShowLevelLoadingScreen();

    // MyBlueprintFunctionLibrary.cpp
    #include “MoviePlayer.h”

    void UMyBlueprintFunctionLibrary::ShowLevelLoadingScreen()
    {
    FLoadingScreenAttributes LoadingScreen;
    LoadingScreen.bAutoCompleteWhenLoadingCompletes = true;
    LoadingScreen.WidgetLoadingScreen = FLoadingScreenAttributes::NewTestLoadingScreenWidget();
    GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);
    }

  • Have a blueprint setup like this in player character:

  • Start the game as “Standalone Game”
  • Press the M key
  • The game crashes now with the following crash log: [Crash Log Dump][2]
  • It does however not crash if you don’t call the show loading screen function before level load

Related to the focus issue (#2):

  • Do the steps above
  • Add back the loading screen function
  • Remove the whole begin play function
  • Mouse focus now doesn’t work after loading the level (press M key) until player clicks mouse button

Hey dgrieshofer,

Thank you for your report. We have assigned this issue to a member of our support staff, and they will begin investigation as soon as possible. If we are unable to reproduce the issue, or we need additional information, our staff member will comment here with additional questions. Otherwise, we will post an ‘Answer’ once we have logged the issue in our bug database or we have a solution for it.

In the meantime, please be sure to review our suggestions for how to report a bug, and feel free to edit your post if you have additional information to provide:

Please zip and attach the crash log and dump file for your project after a crash.

Thanks!

Hello dgrieshofer,

I was unable to reproduce this on my end. I have a few questions for you about this issue that will help us better understand what’s happening. Any additional information will be helpful.

Quick questions:

  1. Can you reproduce this issue on a clean project?
  2. Can you provide steps to reproduce this issue?
  3. Can you provide a screen shot of the section of blueprints being referenced?

Hey Rudy, I have looked into this further and it seems like this is rather complicated to replicate but I have added all necessary steps and attached the crashlog/dump in the original post. Hope it helps, let me know if you need more feedback.

Hello dgrieshofer,

I have a couple more questions for you.

  1. Would please explain how you declared the function ShowLevelLoadingScreen?
  2. In what blueprint did you put the three nodes in the second image (Custom event, Level loading and open level)?

I have edited the initial post again showing all steps and all required changes needed from the first person game template to make it crash. The custom event was just a placeholder for a bound key. Btw I have now also found out that the mouse focus issue that I am experiencing is also related to that loading screen which would be great to fix too. More info can be seen in the origin post. Thanks

Hello dgrieshofer,

We were able to reproduce the issue that you are experiencing. I have filled out a report (UE-4758) and sent it to the developers for further investigation. I will provide any more pertinent information as it becomes available. Thank you for your time and assistance.

Hi
I’m experiencing the exact same issue. I have the same call stack as what he has in the crash dump. The crash occurs after the movie player stops and the level is actually about to be loaded. Has this issue been resolved yet?

Hello paras.chaudhary,

After taking a quick look I have found that this has recently been fixed. This crash should be resolved in the 4.7 version of the engine. I hope that this information helps.

Make it a great day

Anything happen with this? I’m on 4.7.6 right now (I know, a bit behind), but I’m having the same problem.

Hello BrynBennett,

This issue was resolved in the 4.8 version of the engine. I have included a link to the commit in case you are using an engine built from source and you would like to cherry pick the solution for your project. I hope this helps.

Commit: https://github.com/Crtriplett/UnrealEngine/commit/774da3310a3b833688d02dbd1ebd75f204dcdec5

Make it a great day

Thank you so much Rudy! Unfortunately, those changes already made it into the version of the engine we are using. Could there be any other commits that fixed the issue?

Hello BrynBennett,

The issue that you are experiencing may not be the same issue that was reported in this post. You may want to create a new thread and provide more information on this issue that you are experiencing.

I was calling GetMoviePlayer()->PlayMovie() when I didn’t need to. I didn’t know that it would happen automatically. Evidently, that causes a crash. Thanks for your time.