So I just spent a lot of time trying to find out why my UProjectileMovementComponent couldnt be found by the compiler, it kept telling me the following error:
Error: identifier “UProjectileMovementComponent” is undefined
error C2065: 'UProjectileMovementComponent ': undeclared identifier
error C2923: ‘TSubobjectPtr’: ‘UProjectileMovementComponent’ is not a valid template type argument
And after some searching I found out that I had to change the #include “EngineMinimal.h” to #include “Engine.h”
EngineMinimal is designed to be included in your PCH. I seem to always need to include it or I get compile errors in engine code (possibly because Unreal code is expecting it or requires specific include ordering?).
Engine.h is huge and including it will probably slow down your compile. It’s better to include the headers for the functionality you’re using (include Actor.h when creating Actors or ProjectileMovementComponent.h when using UProjectileMovementComponent).