Select component type in editor

Hello ,

Can I assume that your custom camera component inherits from UCameraComponent? If this is the case, your first method is almost correct. You can remove the line about creating a UClass variable and replace the line in the 3rd step with:

Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));

After doing this, if you create a blueprint based off the pawn, you should see a “Camera” variable in the details panel. Due to the TSubclassOf, the dropdown should include CameraComponent and any class / blueprint that inherits from it.

You also may need to add the “EditAnywhere” specifier to the UPROPERTY declaration.