UE4

[UE4] OpenLevel

TigerFish 2022. 8. 22. 00:24

글을 쓰는 이유 

 

OpenLevel 사용법을 기록하기 위해 글을 쓴다. 


작업 환경

 

UE4.26


OpenLevel 사용법

 

UGamePlayStatics::OpenLevel 을 사용하면 레벨을 로드 할 수 있다. levelName에 Level을 쓸 수도 있지만 Level을 찾는 검색시간이 상당히 오래 걸리기 때문에 full path로 쓰는게 좋다. 또한 Option을 통해 게임 모드를 로드하는 레벨에 설정할 수 있다. 

 

FString option = TEXT("?game=/Game/Blueprint/GameMode/TestGameModeBP.TestGameModeBP_C");
FString levelName = L"/Game/Maps/TestLevel"
UGameplayStatics::OpenLevel(inWorld, *levelName, true, option);

참고

 

https://forums.unrealengine.com/t/change-gamemode-on-open-level/296156/2

 

Change GameMode on Open Level

Hi OhiraKyou, I apologize for the delayed reply, your post seems to have been buried and we just found it. Are you still experiencing this error?

forums.unrealengine.com

https://docs.unrealengine.com/4.27/en-US/API/Runtime/Engine/Kismet/UGameplayStatics/OpenLevel/

 

UGameplayStatics::OpenLevel

Travel to another level

docs.unrealengine.com

 

'UE4' 카테고리의 다른 글

[UE4][Editor]스트리밍 레벨 조작  (0) 2023.02.28
[UE4][Editor]맵 이벤트  (0) 2023.01.17
[UE4][Editor] Asset 저장  (0) 2022.07.25
[UE4] Animation 덧붙이기  (0) 2022.05.29
UE4 코드에서 DataTable 사용  (0) 2022.04.18