# error when I try to setup spring arm RelativeRotation

**URL:** <https://forums.unrealengine.com/t/error-when-i-try-to-setup-spring-arm-relativerotation/471396>\
**Category:** Cinematics & Media\
**Tags:** unreal-engine, question\
**Created:** [September 15, 2020, 7:35pm UTC](https://forums.unrealengine.com/t/error-when-i-try-to-setup-spring-arm-relativerotation/471396 "2020-09-15T19:35:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![william2013987](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@william2013987](https://forums.unrealengine.com/u/william2013987)\
**Post date:** [September 15, 2020, 7:35pm UTC](https://forums.unrealengine.com/t/error-when-i-try-to-setup-spring-arm-relativerotation/471396/1 "2020-09-15T19:35:53Z")

</div>

I am trying to setup a sping arm and camera like that in a course:

```
#include "MyPawn.h"
#include "Components/InputComponent.h"
#include "Math/UnrealMathUtility.h"
#include "GameFramework/SpringArmComponent.h"
#include "Camera/CameraComponent.h"

AMyPawn::AMyPawn()
{
    SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
SpringArm->SetupAttachment(GetRootComponent());
SpringArm->RelativeRotation = FRotator(-45.f, 0.f, 0.f);
SpringArm->TargetArmLength = 400.f;
SpringArm->bEnableCameraLag = true;
SpringArm->CameraLagSpeed = 3.f;

Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
Camera->SetupAttachment(GetRootComponent());

```

But I get these errors why ?

> Severity Code Description Project File Line Suppression  
> State Error (active) E0265 member  
> “USceneComponent::RelativeRotation”  
> (declared at line 158 of  
> “C:\Unreal\UE\_4.25\Engine\Source\Runtime\Engine\Classes\Components\SceneComponent.h”)  
> is inaccessible ccourse C:\Unreal  
> Projects\ccourse\Source\ccourse\MyPawn.cpp 18
> 
> Severity Code Description Project File Line Suppression  
> State Error C4458 declaration of  
> ‘Camera’ hides class  
> member ccourse C:\Unreal  
> Projects\ccourse\Source\ccourse\MyPawn.h 41

> Severity Code Description Project File Line Suppression  
> State Error C4458 declaration of  
> ‘Camera’ hides class  
> member ccourse C:\Unreal  
> Projects\ccourse\Source\ccourse\MyPawn.h 41

---

<div class="post-metadata">

**Author:** ![EvilCleric](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvilCleric](https://forums.unrealengine.com/u/EvilCleric)\
**Post date:** [September 15, 2020, 7:59pm UTC](https://forums.unrealengine.com/t/error-when-i-try-to-setup-spring-arm-relativerotation/471396/2 "2020-09-15T19:59:22Z")

</div>

Use _SetRelativeRotation_.
