Skip to content

Commit 3458af6

Browse files
committed
Fix player controls to be disabled when UI focused sth else than gameplay
1 parent e10c800 commit 3458af6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Source/Game/Core/MyPlayerController.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using ArizonaFramework;
3+
using ArizonaFramework.UI;
34
using FlaxEngine;
45

56
namespace Game
@@ -92,7 +93,9 @@ public override void OnUpdateInput()
9293
var pawn = PlayerPawn as MyPlayerPawn;
9394
if (pawn == null)
9495
throw new Exception("Missing player pawn.");
95-
var useInput = Engine.HasGameViewportFocus && !UserManager.Instance.IsGamePaused;
96+
var useInput = Engine.HasGameViewportFocus &&
97+
!UserManager.Instance.IsGamePaused &&
98+
UISystem.Instance.InputContext == InputContextType.Gameplay;
9699

97100
// Movement
98101
if (useInput)

0 commit comments

Comments
 (0)