@@ -29,10 +29,6 @@ namespace RobotecSpectatorCamera
29
29
RobotecSpectatorCameraRequestBus::Handler::BusConnect (GetEntityId ());
30
30
AZ::TickBus::Handler::BusConnect ();
31
31
AzFramework::InputChannelEventListener::Connect ();
32
- AzFramework::InputSystemCursorRequestBus::Event (
33
- AzFramework::InputDeviceMouse::Id,
34
- &AzFramework::InputSystemCursorRequests::SetSystemCursorState,
35
- AzFramework::SystemCursorState::ConstrainedAndHidden);
36
32
37
33
AZ::TransformBus::EventResult (m_currentTransform, GetEntityId (), &AZ::TransformBus::Events::GetWorldTM);
38
34
}
@@ -119,6 +115,10 @@ namespace RobotecSpectatorCamera
119
115
// Capture the initial mouse position and cursor state
120
116
m_initialMousePosition = GetCurrentMousePosition ();
121
117
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);
122
122
}
123
123
else if (inputChannel.IsStateEnded ())
124
124
{
@@ -132,6 +132,10 @@ namespace RobotecSpectatorCamera
132
132
133
133
// Update m_lastMousePosition to the restored position to prevent the jump on the next rotation start
134
134
m_lastMousePosition = m_initialMousePosition;
135
+ AzFramework::InputSystemCursorRequestBus::Event (
136
+ AzFramework::InputDeviceMouse::Id,
137
+ &AzFramework::InputSystemCursorRequests::SetSystemCursorState,
138
+ AzFramework::SystemCursorState::ConstrainedAndVisible);
135
139
}
136
140
}
137
141
0 commit comments