관리 메뉴

기억을 위한 기록들

[UE4-CPP] 개인메모 PrimitiveComponent Overlap C++ 구현 본문

UnrealEngine/UE4 - CPP

[UE4-CPP] 개인메모 PrimitiveComponent Overlap C++ 구현

에드윈H 2021. 6. 20. 15:39

헤더파일

	UPROPERTY()
	USphereComponent* Trigger;

 

	UFUNCTION()
		void OnOverlapBegin( class UPrimitiveComponent* selfComp, class AActor* otherActor, UPrimitiveComponent* otherComp,
			int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

 

 

cpp파일

- 생성자

	Trigger->OnComponentBeginOverlap.AddDynamic( this, &해당클래스::OnOverlapBegin );

 

 

void 해당클래스::OnOverlapBegin( class UPrimitiveComponent* selfComp, class AActor* otherActor, UPrimitiveComponent* otherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult )
{
	UE_LOG( LogTemp, Log, TEXT("OverLap") );
}