Can't attach camera to capsule component

try explicitly casting the type:

FPSCameraComponent->SetupAttachment(Cast<USceneComponent>(GetCapsuleComponent()));

if the cast fails, please try to #include both “USceneComponent.h” and “UCapsuleComponent.h”

does it work now?

1 Like