I'm having trouble getting the position of the mouse cursor.

debug

When the character is not moving, the position of the mouse cursor is returned correctly, but when it starts moving, a strange value is returned.

Where did the problem come from?

you might have OrientRotationToMovement on or something fighting with the mouse