title: Unreal Engine 4: Problem with attach camera to spring arm
body: <p>I have problem with attach camera to spring arm in Unreal Engine 4. Please help me.</p>
  
  <p>ACharacter.h:</p>
  
  <pre><code>protected:
  
      UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Components")
          UCameraComponent* CameraComp;
  
      UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components")
          USpringArmComponent* SpringArmComp;
  </code></pre>
  
  <p>ACharacter.cpp:
  Code:</p>
  
  <pre><code>ACharacter::ACharacter()
  {
  
      SpringArmComp = CreateDefaultSubobject&lt;USpringArmComponent&gt;(TEXT("SpringArmComp"));
      SpringArmComp-&gt;bUsePawnControlRotation = true;
      SpringArmComp-&gt;SetupAttachment(RootComponent);
  
      CameraComp = CreateDefaultSubobject&lt;UCameraComponent&gt;(TEXT("CameraComp"));
      CameraComp-&gt;SetupAttachment(SpringArmComp, USpringArmComponent::SocketName);
  }
  </code></pre>
  
  <p>After run, camera is on the floor and don't follow the character (player). And camera isn't attachment to spring arm (I see it in BP).
  I watched a lot of tutorials on YT, but it didn't solve my problem.</p>