로그 출력 화면 보기
창 -> 개발자 툴 -> 출력 로그
로그 출력하기
void AMyActor::BeginPlay()
{
Super::BeginPlay();
UE_LOG(LogTemp, Log, TEXT("Log Message"));
}
좀 더 다양한 로그형태 사용
void AMyActor::BeginPlay()
{
Super::BeginPlay();
UE_LOG(LogTemp, Error, TEXT("Error Message"));
UE_LOG(LogTemp, Warning, TEXT("Warning Message"));
UE_LOG(LogTemp, Display, TEXT("Display Message"));
}
다양한 변수 출력
void AMyActor::BeginPlay()
{
Super::BeginPlay();
FString CharacterName = TEXT("HiWer");
UE_LOG(LogTemp, Log, TEXT("Charater Name = %s"), *CharacterName);
bool isAttackable = ture;
UE_LOG(LogTemp, Log, TEXT("isAttackable = %s"), isAttackable ? TEXT("true") : TEXT("false"));
int hp = 100;
UE_LOG(LogTemp, Log, TEXT("HP = %d"), hp);
float AttackSpeed = 1.0f
UE_LOG(LogTemp, Log, TEXT("AttackSpeed = %f"), AttackSpeed);
FVector CharacterPosition = GetActorLocation();
UE_LOG(LogTemp, Log, TEXT("CharacterPosition = %s"), CharacterPosition.ToString());
}