분류 전체보기

    [Unreal] 인스턴스와 서브시스템 (Instance/SubSystem) 갖고오는 방법

    Instance 가져오는 방법 1) Kismet/GameplayStatics.h 헤더 파일 안에 있는 UGameplayStatics 내 static 함수 사용. UGameplayStatics::GetGameInstance(GetWorld())->GetSubsystem(); 2) UWorld 클래스 내 static 함수 사용 GetWorld()->GetGameInstance(); SubSystem 가져오는 방법 1) UGameInstance 클래스 내 static 함수 사용. UGameInstance::GetSubsystem(GetWorld()->GetGameInstance()); 2) UWorld 클래스 내 static 함수 사용 if (auto pWorld = GetWorld()) pWorld->Get..

    [Unreal] 충돌 관련 함수

    /** * Delegate for notification of blocking collision against a specific component. * NormalImpulse will be filled in for physics-simulating bodies, but will be zero for swept-component blocking collisions. */ DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_FiveParams( FComponentHitSignature, UPrimitiveComponent, OnComponentHit, UPrimitiveComponent*, HitComponent, AActor*, OtherActor, UPrimitiveCompon..

    [Unreal] 클래스 생성 시 소스 파일 기본 주석 제거

    클래스 생성 시 헤더 파일과 cpp파일이 아래와 같이 생성된다, 하지만 매번 주석 지우는건 되게 귀찮은 작업이다. 아래 경로를 통해 .h.template 파일과 .cpp.template 파일을 찾는다. 적당하게 메모장으로 옮겨 지울 주석을 찾아본다.

    [Unreal] C++ 흔한 헤더파일 오류와 해결방법

    클래스 이름. cpp(1): error : Expected 클래스 이름. h to be first header included. 원인) cpp에서 클래스명 .h를 최초로 포함(include) 하지 않음. 해결) 최초로 포함시키면 됨. (이 파일에 사용하는 클래스명은, 접두사 U,F,A,I등을 제외). AMyActor 클래스에서 #include “AMyActor.h”가 아닌 #include “MyActor.h” 함수 이름 inconsistent dll linkage 원인) _API는 클래스, 함수, 변수를 정의한 모듈이 아니므로 복사했을 때 선언부와 다르면 클래스가 포함되지 않음. 해결) class MYMODULE_API AMyActor : public AActor // ^^^^^^^^^^^^ 모듈명이 C..