Hi I have a problem in RelativeRotation

Hi I’m following the tutorial from 1. 컴포넌트 만들고 붙이기 | 언리얼 엔진 문서

and I erasing error one by one adding include s
include “Components/SphereComponent.h”

include “Particles/ParticleSystemComponent.h”

include “GameFramework/SpringArmComponent.h”

include “Camera/CameraComponent.h”

and the last error is the problem
/home/wavetips/Documents/Unreal Projects/HowTo_Components/Source/HowTo_Components/CollidingPawn.cpp:42:16: error: ‘RelativeRotation’ is a private member of ‘USceneComponent’
SpringArm->RelativeRotation = FRotator(-45.f, 0.f, 0.f);
^
/home/wavetips/Downloads/Linux_Unreal_Engine_5.2.1/Engine/Source/Runtime/Engine/Classes/Components/SceneComponent.h:141:11: note: declared private here
FRotator RelativeRotation;

I don’t know how to erase that error RelativeRotation
I’ve searched google and I can’t find the clue…

Use SetRelativeRotation instead

SpringArm->SetRelativeRotation(FRotator(-45.f, 0.f, 0.f));
1 Like

Thanks! That was fast!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.