Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- game ability system
- ue4 error
- 아이작 맵 생성
- tick처럼 사용
- multithreard chat
- 언리얼
- UE5
- 언리얼 자기장
- UnrealEngine
- 13iew
- UE
- 채팅 서버
- draw call skeletal mesh
- Unreal Engine 4
- 랜덤 맵 생성
- Random Map Generator
- Unreal Engine Error
- unity
- tick 사용하지 않고
- Unity Engine
- Ai
- ue4 Crash
- unreal engine 5 merge mesh
- Unreal Engine 5
- LittleNightMare
- Chat Server
- deltaTime
- UE4
- unreal engine
- bluezone
Archives
- Today
- Total
Class GameDev* SheepAdult
[Unreal Engine] Game Pause 시 특정 키 입력 가능하게 하기 본문
메뉴를 열거나 pause 키로 게임을 중단시키고 싶을 경우 일반적으로
UGameplayStatics::SetGamePaused(GetWorld(), true);
를 사용해 게임을 중단시킨다. 그리고 다시 게임으로 돌아오기 위해 ESC를 누르거나 P키(일반적으로 Pause키)를 누르면 안 눌러지는 것을 알 수 있다. 왜냐하면 게임이 중단되면 Input도 중단되기 때문이다. 그러면 FlipFlop형태로 중단했다가 재개하려면 어떻게 해야 할까?
블루프린트를 살펴보면 아래와 같은 bool 값이 있다.
저기 Execute when Paused가 있는 것을 알 수 있는데 저것을 true로 바꿔주면 된다. c++ 에선 아래와 같다.
void AMainCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
check(PlayerInputComponent);
PlayerInputComponent->BindAction("ESCMenu", IE_Pressed, this, &AMainCharacter::ESCMenu).bExecuteWhenPaused = true;
}
입력 키를 함수와 바인드 시켜줄 때 작성해 주면 된다.