Skip to content

Commit 9ffd602

Browse files
authored
Merge pull request #50 from RobotecAI/pantosz/hide_cursor
Removed cursor visibility in game mode
2 parents 6d6a10b + ffbea04 commit 9ffd602

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Gems/RobotecSpectatorCamera/Code/Source/SpectatorCamera/SpectatorCameraComponent.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ namespace RobotecSpectatorCamera
115115
// Capture the initial mouse position and cursor state
116116
m_initialMousePosition = GetCurrentMousePosition();
117117
m_ignoreNextMovement = true; // Flag to ignore the next mouse movement preventing jump on re-centering
118+
AzFramework::InputSystemCursorRequestBus::Event(
119+
AzFramework::InputDeviceMouse::Id,
120+
&AzFramework::InputSystemCursorRequests::SetSystemCursorState,
121+
AzFramework::SystemCursorState::ConstrainedAndHidden);
118122
}
119123
else if (inputChannel.IsStateEnded())
120124
{
@@ -128,6 +132,10 @@ namespace RobotecSpectatorCamera
128132

129133
// Update m_lastMousePosition to the restored position to prevent the jump on the next rotation start
130134
m_lastMousePosition = m_initialMousePosition;
135+
AzFramework::InputSystemCursorRequestBus::Event(
136+
AzFramework::InputDeviceMouse::Id,
137+
&AzFramework::InputSystemCursorRequests::SetSystemCursorState,
138+
AzFramework::SystemCursorState::ConstrainedAndVisible);
131139
}
132140
}
133141

0 commit comments

Comments
 (0)