Camera moving uncontrollably when using remote/streaming clients (Moonlight/Sunshine or Steam Link)
What happened?
If you're trying to play FiveM through any remote/streaming client, be it Moonlight/Sunlight, be it Steam Link, the mouse cursor will be uncontrollably moving in the top left corner of the screen. Either way, for whatever reason, you are able to move the mouse in order to connect to a server, but stopping will teleport the cursor back to the top left.
If you manage to get into a server, any mouse movement will uncontrollably move the camera.
https://youtu.be/QOSYPv64ihA?feature=shared
In the video above, you can observe at first that moving my host PC's mouse will work without any problems, but any mouse movement on the remote PC will instantly uncontrollably move the camera. Clicking works (the punch), it's just the mouse movements that are bugged.
Expected result
The mouse movements should work on remote/streaming clients, but it doesn't, making the camera move uncontrollably
Reproduction steps
- Install any remote PC/streaming client, be it Moonlight with Sunlight or launch FiveM through Steam Link.
- Launch FiveM from the remote client.
- Observe the mouse cursor being stuck/spazzing out in the top left corner of the screen.
- Join a server.
- Move the mouse while observing an uncontrollably moving camera.
Importancy
Unknown
Area(s)
FiveM
Specific version(s)
FiveM Canary, build 15156 or b3258
Additional information
I suppose this happens on any kind of remote PCs like Parsec, ShadowPC, or any other "cloud gaming" services.
Nvidia Shadowplay is disabled by default (recording or Instant Replay doesn't work). I thought it might fix the problem if I enable Shadowplay, but it didn't. Recording/Instant Replay works but FiveM still has the issue presented above.
Issue is related to this one from RedM: https://github.com/citizenfx/fivem/issues/2578
Hello do you know how to slove this problem
Tested again today with latest pre-release version of Sunshine (v2025.611.5625), and it's working flawlessly. Don't know if it's fixed on your side or on their side, but for now it's fixed. Will continue testing and will keep you updated in this thread in case of anything.
Thank you!
hi, I've been having the same issue but I switched to the latest pre-release (which seems to be 2025.615.24501 at the time of writing) and it still doesn't work. did you only update sunshine or did you do other things as well?
found the actual workaround that helped me, didn't know until now when i tried again.
install Parsec and either use that, or go back to using Moonlight/Sunshine, but keep parsec installed and (i think) also opened. it seems it works without any problems IF parsec is installed. no idea why and how, doesn't really make any sense to me, but it seems that's the workaround.
I found a fix as well, though the game is limited to 60Hz. In the game itself I changed it from fullscreen mode to fullscreen (exclusive) mode and then it seems to work fine.
Can confirm. Changing from Fullscreen to Fullscreen (Exclusive) (AKA Windowed borderless) fixed this issue. No parsec or any other third-party software needed. This doesn't happens on vainilla GTA V, so there's totally an issue with FiveM itself.
My environment:
Server (the PC running FiveM):
- Windows 11 x64
- 32GB RAM
- RTX 3080
- Single screen (1280x720)
- Sunshine, GTA V, OS and FiveM up to date using stable branches (the GPU has an older driver because of compatibility concerns)
Client (The PC running Moonlight)
- SteamDeck
- Using Gamemode
- No mouse, mousepad, keyboard or external gamepad connected (just using the attached gamepad)
- Streaming in 1280x800 (native resolution for the SteamDeck)
- Touchscreen is not being touched
- The mouse works fine once closing FiveM. Also works if streaming GTA V even at the same session (using Desktop Mode from Moonlight)
- Moonlight and SteamOS Is up to date using stable branches
The cause of the problem seems to be the same as this: https://github.com/citizenfx/fivem/issues/2726
As you can see, this is an issue that hasn't been addressed in over a year
Can confirm. Changing from Fullscreen to Fullscreen (Exclusive) (AKA Windowed borderless) fixed this issue. No parsec or any other third-party software needed. This doesn't happens on vainilla GTA V, so there's totally an issue with FiveM itself.
My environment:
Server (the PC running FiveM):
- Windows 11 x64
- 32GB RAM
- RTX 3080
- Single screen (1280x720)
- Sunshine, GTA V, OS and FiveM up to date using stable branches (the GPU has an older driver because of compatibility concerns)
Client (The PC running Moonlight)
- SteamDeck
- Using Gamemode
- No mouse, mousepad, keyboard or external gamepad connected (just using the attached gamepad)
- Streaming in 1280x800 (native resolution for the SteamDeck)
- Touchscreen is not being touched
- The mouse works fine once closing FiveM. Also works if streaming GTA V even at the same session (using Desktop Mode from Moonlight)
- Moonlight and SteamOS Is up to date using stable branches
Hey @JPZV can you detail how you changed from Fullscreen to Fullscreen (Exclusive) (AKA Windowed borderless)? I don't see options for this in fivem itself? I've tried passing the param -windowed to fivem.exe and this doesn't fix it for me. Was this done in moonlight, in GTA5 game settings or somewhere in fivem, or maybe an additional parameter to fivem?
Hey @JPZV can you detail how you changed from Fullscreen to Fullscreen (Exclusive) (AKA Windowed borderless)? I don't see options for this in fivem itself? I've tried passing the param -windowed to fivem.exe and this doesn't fix it for me. Was this done in moonlight, in GTA5 game settings or somewhere in fivem, or maybe an additional parameter to fivem?
You won't see the Fullscreen (Exclusive) option unless you switched to fullscreen first, then exited the settings, once you go back into the game settings then you'll see the option for Exclusive
Doesn't fix it for me. It happens with all screen format types. Even when I set it to windowed smaller than the screen, it bounces to the top left of the primary screen (not the window) when fivem/gta is not in focus instead. If in focus, it flickers to the top left of the gta/fivem window. I'm pretty sure this is dependent on how FiveM captures the mouse. Inputs that set the mouse position instead of giving translation glitch out the system.
So this has been an issue since May last year. I'm frustrated with waiting. So I looked at commits with cursors around that time. The only one I can find is Commit 7007fc1. It has to do with cursor clipping code/components/rage-input-five/src/InputHook.cpp I do not see any other files changed how they handled cursor things around that time.
My theory now is that it has to do with how the clipping handles absolute cursor input device data instead of delta cursor input device data. It could be wrong, but maybe this lead will give someone who can fix it the motivation to have a look.
You can get past it if you don't connect until the game is loaded, the launcher seems to be the big issue. YMMV