C++ Loading Screen

Hello All!

I am new to the C++ side of Unreal and its API so forgive me if I seem dumb at all.

I have been following this on the Wiki to create a better Loading Screen: Loading Screen

After moving this into my project Game Instance I am getting the error: “Incomplete Type is not allowed” from



struct MOVIEPLAYER_API FLoadingScreenAttributes

I am getting this error no matter where I put the code:

struct MOVIEPLAYER_API FLoadingScreenAttributes
Blah Blah Blah. Code from the Wiki page

Also, here I get the error “identifier GetMoviePlayer is undefined”


After adding this include:

#include "..\MoviePlayer\Public\MoviePlayer.h"

This code:

"FLoadingScreenAttributes LoadingScreen;"

starts throwing the error

expected a ";" on LoadingScreen

Sorry if this is very messy. As I said; I don’t know much about the Unreal API. Feel free to answer any sections of this question.

I understand that this is designed for an older version of UE4 so it needs updating.

Thanks for any help.

Just out of curiosity, try this as your include
#include “Runtime/MoviePlayer/Public/MoviePlayer.h”

Also LoadingScreenAttributes LoadingScreen should possibly be FLoadingScreenAttributes LoadingScreen;

Im no master of c++ either so apologies if the above don’t help at all, just suggesting ideas.

Sadly that doesn’t work. Think I may have made a spelling error above. It was already “FLoadingScreenAttributes LoadingScreen;” in my code.

Go to your Build.cs file and add “MoviePlayer” to your PublicDependencyModuleNames.

Should look something like this when it’s done:

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "MoviePlayer" });

then in your class where you’re using the movie player,

#include "Runtime/MoviePlayer/Public/MoviePlayer.h"

It is enough to include movie player like this

#include "MoviePlayer.h"

but in order to make it work you should add the public dependencies in your build.cs

My for example looks like so:

	PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" , "UMG" , "AIModule", "RHI", "RenderCore" , "MoviePlayer" });

I think this is what you need so far

Also I know that the loading screen is also a slate based thingy so maybe you should also include a slate to the private dependencies:

PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });

I just ran into the same problem.
I got it to work by adding the movie player to PublicDependencyModuleNames as Xavice said and including the header

After that, you need to Regenerate your visual studio files by right clicking on your Unreal Engine Project File and hit “Generate Visual Studio Project Files”.