Hi,
I recently found this tutorial: Shooter Game - Toggle Third Person
But, It appeared some compile errors at the end of the tutorial, when adding the new camera part to the ShooterCharacter constructor: (I’m using version 4.10)
ThirdPersonCameraArm = ObjectInitializer.CreateDefaultSubobject<USpringArmComponent>(this, TEXT("ThirdPersonCameraArm"));
ThirdPersonCameraArm->TargetOffset = FVector(0.f, 0.f, 0.f);
ThirdPersonCameraArm->SetRelativeLocation(FVector(-40.f, 0.f, 160.f));
ThirdPersonCameraArm->SetRelativeRotation(FRotator(-10.f, 0.f, 0.f));
ThirdPersonCameraArm->AttachTo(GetMesh()); // attach it to the third person mesh
ThirdPersonCameraArm->TargetArmLength = 200.f;
ThirdPersonCameraArm->bEnableCameraLag = false;
ThirdPersonCameraArm->bEnableCameraRotationLag = false;
ThirdPersonCameraArm->bUsePawnControlRotation= true; // let the controller handle the view rotation
ThirdPersonCameraArm->bInheritYaw = true;
ThirdPersonCameraArm->bInheritPitch = true;
ThirdPersonCameraArm->bInheritRoll = false;
ThirdPersonCamera = ObjectInitializer.CreateDefaultSubobject<UCameraComponent>(this, TEXT("ThirdPersonCamera"));
ThirdPersonCamera->AttachTo(ThirdPersonCameraArm, USpringArmComponent::SocketName);
ThirdPersonCamera->bUsePawnControlRotation= false; // the arm is already doing the rotation
ThirdPersonCamera->FieldOfView = 90.f;
My errors:
- ‘Getmesh’ identifier not found
- identifier ‘GetMesh’ is undefined
I have tried:
- GetMesh()
- GetPawnMesh()
- PawnMesh3p
Any solution to this? I guess it is something simple
/Total