참고자료 (1) : https://docs.unrealengine.com/5.0/ko/unreal-engine-modules/
참고자료 (2) : https://www.youtube.com/watch?v=mgFrFdzb7hg&t=361s
// Called every frame
void AFacePlayerActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (USceneComponent* RootComp = GetRootComponent())
{
if(APawn* LocalPawn = UGameplayStatics::GetPlayerPawn(GetWorld(),0)){
RootComp->SetWorldRotation((RootComp->GetComponentLocation() - LocalPawn->GetActorLocation()).GetSafeNormal().Rotation());
}
}
}