Scene Component를 부모 클래스로 사용하여 생성한다.
tick component에 아래 코드를 추가한다.
float CurrentValueInRadians = FMath::DegreesToRadians<float>(CurrentValue);
SetRelativeLocation(FVector(OrbitDistance * FMath::Cos(CurrentValueInRadians), OrbitDistance * FMath::Sin(CurrentValueInRadians), RelativeLocation.Z));
if(RotateToFaceOutwards)
{
FVector LookDir = (RelativeLocation).GetSafeNormal();
FRotator LookAtRot = LookDir.Rotation();
SetRelativeRotation(LookAtRot);
}
CurrentValue = FMath::Fmod(CurrentValue + (RotationSpeed*DeltaTime),360);
}
캐릭터 주위를 빙빙 도는 방어막 같은 것들을 표현하는데 사용
'Unreal Engine 4 > Unreal Engine 4' 카테고리의 다른 글
2022/04/07 로비메뉴 백업 (0) | 2022.04.07 |
---|---|
2022/03/29 360도 캐릭터 백업 (0) | 2022.03.29 |
계층구조 만들기 (0) | 2022.03.22 |
ConstructorHelpers를 이용한 Object 찾기와 그 에 대한 참조 획득 (0) | 2022.03.22 |
액터는 컴포넌트가 없이 사용이 가능한가?? (0) | 2022.03.21 |