The C++ lines below are directly translated from the compiled version of the blueprints, however, this leads a crash during the compilation stage of the game.
cpp file:
UObject* testobj = LoadObject (nullptr,TEXT(“/Game/Materials/Screen_CapMaterial.Screen_CapMaterial”));
Zoom_Cam->TextureTarget = CastChecked(testobj, ECastCheckedType::NullAllowed);
Relevant header file line:
UPROPERTY(VisibleDefaultsOnly, Category = Mesh)
class USceneCaptureComponent2D* Zoom_Cam;