#include "Components/CapsuleComponent.h"

Hello, I tried to complete this lesson by watching the video and taking notes, and then working through it at the end. I almost got there, but instead of:

#include “Components/CapsuleComponent.h”

in the cpp file, I had:

#include “CapsuleComponent.generated.h”

What is the difference between these, and is there a way I should know which one to use?

The generated headers are only for the respective header. i.e. for the header file Bob.generated.h that should only go in Bob.h and should be the last include in that header.

It’s code Unreal generates when it sees the U macros (UCLASS, UPROPERTY, et al.). Those macros themselves do nothing. They’re just detected by a tool so Unreal can spit some generated code out.

1 Like