https://docs.unrealengine.com/5.2/en-US/API/Runtime/Engine/PhysicsEngine/UPhysicsHandleComponent/
UPhysicsHandleComponent* PhysicsHandle = GetOwner()->FindComponentByClass<UPhysicsHandleComponent>();
// 충돌 일으키기
PhysicsHandle = nullptr;
if (PhysicsHandle != nullptr)
{
PhysicsHandle->GetName();
}
포인터가 null 값이 되면 충돌로 이어질 수 있기 때문에 위험합니다.
컴포넌트 이름을 출력하기
// Called when the game starts
void UGrabber::BeginPlay()
{
Super::BeginPlay();
UPhysicsHandleComponent* PhysicsHandle = GetOwner()->FindComponentByClass<UPhysicsHandleComponent>();
if (PhysicsHandle != nullptr)
{
UE_LOG(LogTemp, Display, TEXT("Got Physics Handle: %s"), *PhysicsHandle->GetName());
PhysicsHandle->GetName();
}
else
{
UE_LOG(LogTemp, Warning, TEXT("No Physics Handle Found!"));
// PhysicsHandle->DestroyComponent();
}
}