Rotate Camera with RMB without showing mouse cursor

Hello,
I am building a mmorpg game with topdown controller. Trying to figure out how to fix mouse cursor on viewport while i am rotating spring arm. Could anyone help? Thanks in advance :slight_smile:

For that, you’ll want to change mouse capture mode
image

You can hover over the options to find what they each do, but you might just want to set it to Capture During Right Mouse Down by default in the project settings.

1 Like


Thank you for reply :slight_smile: but couldn’t fix with this solution. I want to hold left mouse button to keep my character moving while turning camera with right mouse button. But cursor reaches to edge of the screen. I want to fix location where i click rmb on viewport.

There’s a reason games with mouse controls use keys to rotate the camera, or don’t let you do both at once (even this only works well in god-games), and why camera and movement are separate joysticks on controllers. It wouldn’t feel good to use the mouse for both movement and rotation.

I would suggest either using keyboard keys to rotate your camera, or replace mouse movement with keyboard movement.
I can help with either if you’d like.

hi @Aslanov

Are you using Unreal 5.xx?

The enhancedinput system allows this to be very easy

you can grab the mouse x, truncate to integer, clamp to -1 to 1 then use that as your multiplier for the delta rotation (have a rotation speed variable * world delta time * above value)

let me know if this is of interest i can mock something up

Stewart

this might be because you’re using Play-In-Editor, you should try using standalone mode and see if this still happens

if that doesn’t fix it, then try having a big empty widget that covers your whole screen, then maybe you can override the OnMouseButtonDown event, i’ve never done it but i’m sure you can find some tutorials

@rokenrock I tried this concept and it works very effectively. I think Unreal Engine is capable for this feature and I believe I can do it. Also keyboard camera rotation will be only for Delta Rotation Y(Pitch). Even wanting to help is enough for me, thank you very much :slight_smile:

Hi, I’m using UE 5.1. Tried clamping but thats not smooth. I’m using clamp option on zooming character with mwheel.
The problem i have faced is when i click LMB and RMB at the same time i want to fix mouse cursor at the location i click both. When i release both or one of them cursor can move again on viewport. Thank you Stewart :slight_smile:

I have tried all of them. There is something i have to use in blueprint that i couldn’t find a solution yet. Thank you :slight_smile: