So I’ve been trying to get around this problem, encountered it while following the step by step procedure stated in the following link: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums
Haven’t quite been able to get past step #3 under the ‘changing the camera view’ section.
compilation leads to the errors pictorially specified in the screenshots.
I am not sure what you are looking at but the example code is not doing the same thing you are.
AttachTo( ) is a function which takes in arguments.
bool AttachTo
(
USceneComponent * InParent,
FName InSocketName,
EAttachLocation::Type AttachType,
bool bWeldSimulatedBodies
)
This is why you get the error. You are not passing any arguments into the function.
I would recommend doing this:
FirstPersonCameraComponent->SetupAttachment(RootComponent);
Or, if you want to try this, though I do not know if it will work as I am just guessing and never use this:
FirstPersonCameraComponent->AttachTo(GetCapsuleComponent( ), NAME_None, EAttachLocation::SnapToTarget, false);
You could do FirstPersonCameraComponent->AttachTo(GetCapsuleComponent( )) and it should work.
Also SetupAttachment should work as well.