반응형
로그 출력을 쉽게하는 함수를 만드는 과정입니다.
public에 헤더 파일 1개를 만들어준다.
근데 경로를 보면 Intermediate(빌드 과정에서 임시로 생성되는 폴더)이다. 그렇기 때문에 경로를 재지정해줘야된다.
{본인 경로}\Source\Warrior\Public 에 저장하면 된다.
#pragma once
namespace Debug
{
static void Print(const FString& Msg, const FColor& Color = FColor::MakeRandomColor(), int32 InKey = -1)
{
if (GEngine)
{
GEngine->AddOnScreenDebugMessage(InKey, 7.0f, Color, Msg);
UE_LOG(LogTemp, Warning, TEXT("%s"), *Msg);
}
}
}
이렇게 코드를 추가해주면
나중에 GEngin어쩌구저쩌구, UE_LOG저쩌구어쩌구 길게 안적고 Print로 끝낼 수 있다!
// Fill out your copyright notice in the Description page of Project Settings.
#include "Characters/WarriorHeroCharacter.h"
#include "WarriorDebugHelper.h"
void AWarriorHeroCharacter::BeginPlay()
{
Super::BeginPlay();
Debug::Print("Hello UE5");
}
이렇게만 해주면 조금은 편하게 디버깅을 할 수 있을거다
반응형
'UE5(언리얼)' 카테고리의 다른 글
[언리얼5/UE5] Setup Spawn Ability (능력 스폰 설정) (0) | 2024.11.16 |
---|---|
[언리얼5/UE5] SpawnActor사용시 주의 (안움직임) (1) | 2024.11.14 |
[언리얼5/UE5] Hard/Soft Reference (3) | 2024.11.11 |
[언리얼5/UE5] 채팅창 만들기 (EditableText) (7) | 2024.11.07 |
[언리얼5/UE5] Authority, Simulated Proxy, Autonomous Proxy (0) | 2024.10.14 |