Attaching SpringArm+Camera to an independently moving child actor

This works in blueprints, but if I add a C++ class in a similar way, I can’t add it to the blueprint (it shows only the blueprint classes derived in this way)