Please provide working solution for this lesson in 4.20

Hello!

I can’t fix my compilation problem and i definitely can’t find any working solution around. I’ve tryed dozens of #include variation, even with Engine.h. I always had OpenDoor.generated.h error and 100-1000 other errors.
What i should include in cpp and h files??!

Please provide working code, one in Git is only for <4.16

Yes It appears a lot of things have been changed in Unreal 4.20 that won’t work with 4.19 an below.

Hi,

Not sure what build errors you are getting so not sure if my advice will help or not.

Whenever the lecture introduces something new that needs to be included in the CPP class implementation I will generally do the following:

  1. Find that class in the Unreal documentation, for example UWorld class would be found on:
    http://api.unrealengine.com/INT/API/Runtime/Engine/Engine/UWorld/
  2. Scroll to the bottom of the page and find the include, “Runtime/Engine/Classes/Engine/World.h”
  3. Copy the include to the .h or .cpp (as needed), add decoration and remove the Runtime portion so it reads:
    #include “Engine/Classes/Engine/World.h”

This generally works for me, I am running 4.20.2.

Other examples are:
#include “Engine/Classes/Components/StaticMeshComponent.h”
#include “Engine/Classes/Kismet/GameplayStatics.h”

For me, doing this allows both for successful compile and intellisense. What I have done is probably not the correct way but it seems to work.

Hope this helps.

Chris.

Privacy & Terms