본문 바로가기

UE4,언리얼4

모든 위젯을 삭제 하기

언리얼4에서 현재 그려져 있는 (보이지 않게 숨겼더라도) 모든 위젯을 삭제하기위해서

아래 호출이 필요하다.


---------------------------------------------------------------------------------------------------

UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject);

if ( World && World->IsGameWorld() )

{

if ( UGameViewportClient* ViewportClient = World->GetGameViewport() )

{

ViewportClient->RemoveAllViewportWidgets();

}

}

---------------------------------------------------------------------------------------------------