Hello!
I found a solution for this problem, thought I am a complete amateur with Unreal Engine still. You need to change 2 different settings sections to get it working.
-
In project settings, search for Mouse under Engine Input, and set them to this:
-
In your PlayerController class, in the Details panel, search Mouse, and set them to this: