PhysicsHandle로 객체 잡기

ChangJin·2023년 10월 30일
0

Unreal Engine5

목록 보기
15/102
post-thumbnail

UPhysicsHandleComponent를 이용한 물체 잡기

cpp

UPhysicsHandleComponent* UGrabber::GetPhysicsHandle() const
{
	UPhysicsHandleComponent* Result = GetOwner()->FindComponentByClass<UPhysicsHandleComponent>();
	if (Result == nullptr)
	{
		UE_LOG(LogTemp, Error, TEXT("Grabber requires a UPhysicsHandleComponent."));
	}
	return Result;
}

h

UPhysicsHandleComponent* GetPhysicsHandle() const;
  • GetPhysicsHandle()가 상수인 이유
    • cpp에서 이 함수를 호출할 때 아무것도 변하지 않기 때문임
    • 단순 log 찍기만 존재하기 때문
profile
Unreal Engine 클라이언트 개발자

0개의 댓글