UNREAL 4 - Mouse rotation stops working if i show cursor and make a click, why? UE4.20 BUG?

Hi, i used my mouse to make my character yaw and pitch… but i wanted to show my cursor on screen, to also be able to select things instead of using a centered widget, so i enable mouse cursor and it Worked great, my character rotates following my mouse… BUT, if i make a click on screen…. it stops working

and then i have to keep any of my mouse buttons pressed to make my character rotation to work, like draging with mouse, i tried to disable click, by set enable click events to false, but it doesn´t work, every time i click on screen, my characters stops following my cursor.

Please help.

Hi, I assumed that the things you are selecting are objects in game and not UMG widget elements.

These are the settings I have to achieve the result you are looking for.

Under Project settings ->Engine->Input
-Use mouse for touch ->unchecked
-Capture Mouse on Launch ->Checked
-Default viewport mouse capture mode ->Capture Perm. including initial mouse down
-Default viewport mouse lock mode ->Lock on Capture

In your control camera actor/pawn blueprint(should also work in level blueprint), use “Set Input Mode Game only” node.

This should make your character follow the cursor even when you click on the screen.

Ok, everything was exactly as you describe and still if i make a click, my character stops responding to mouse movement, i dont have a control camera actor/pawn but i added this to begin play for both pawn event grap and level BP and still dosn´t work if i make a click.

Im not selecting anything, just making a simple click at the screen.

I think it might be a BUG in Unreal 4.20, i replicated the problem on a default flying Project from Unreal, now you can replicate and see what the problem is.

To replicate: create a default flying Project, open flyingpawn BP, connect Event Begin Play to “show mouse cursor”, now to enable mouse, go to “Project settings” create 2 axis mappings, name them “turn” and “lookup”, set turn to “mouse X”, and set look up to “mouse Y”, now return to Flyingpawn BP and make this configuration for “apply forward speed and steering rotation”, it has to be like this:

Now, as you can see, the problem even occours at a default flyingproject from Unreal, i belive this is a bug at Unreal 4.20, since all stepts you mention before are OK at this default Project, even mouse for touch its disable.

While you flight, move cursor, space ship Will follow, make a click and ship Will stop following the mouse movement, i haven´t found a solution jet…

Sorry, forgot to mention that you have to put the set input mode game only node to a a Event Tick node.
I tested it on 4.20 using the first person template and it is working fine.

2 Likes

I tested it using the settings below on the default flying template and it is working too.

defaultflyingtemplate.jpg

Perfect dude! it totally worked… you are awesome for helping so fast!

…. i just wish i did not had to use “Event tick” i hate it…

Thanks man

Do you know how to always keep the flying ship behind the mouse cursor position at the screen?

I want to be able to move my mouse freely, choose a target at any position on my screen, then in 2 or 3 seconds my ship Will smoothly move behind my cursor position, and now both are aligned and centered, do you know how?

If i dont do this, when i move my mouse cursor to the right, the mouse Will keep this right position at the screen, my ship Will be centered because the spring arm and camera are attached to the ship, but my mouse cursor wont be aligned to my ship anymore, creating navigation problems.

Please help man

If i understand correctly you want the flying ship to follow the mouse cursor on screen. You could try using the get mouse position node to get the cursor location in X and Y, with this info you can move the flying ship (set actor location) to the cursor current location.(Can use the Vinterp to node to smooth out the movement).

There are also some options under the spring arm -> Lag which can smooth out the camera movement , play around the values to adjust to your needs/preferences.

This is how i did it in Level Bp Event Tick–(GetGameMode)-cast to (GameModeName)–(GetPlayerController)-Set Input Mode Game Only

Any new on these? I had the same problem on 4.25. Leaving on tick leaves a bad taste in the mouth. is there any clean way to do this?

1 Like

I’m also looking forward to learn without tick solutions here, @Everynone maybe you can help us…

This is old but it might be related / still valuid:

1 Like

Yes! Thank you!