The problem with that is now I get an error when compiling:
error C2679: binary '=': no operator found which takes a right-hand operand of type 'UCameraComponent *' (or there is no acceptable conversion)
The code I am using is:
.h:
UPROPERTY(Category = "camera", BlueprintReadWrite, EditAnywhere)
TSubclassOf<UCameraComponent> Camera;
.cpp constructor:
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
Also, dereferencing or casting the created component doesn’t help, not sure how to solve this?