FViewport::LockMouseToViewport isn't working?
When I call FViewport::LockMouseToViewport nothings seams to happen. Is there a misunderstanding of how this function should be used or is it just not working?
I get the FViewport from casting the Player member in the PlayerController to a ULocalPlayer. Then I call
In 4.6 and forward there are functions that help you setup input modes. One thing they allow is a way to control whether or not the mouse is locked, they also do quite a bit more.
In blueprints use the SetInputMode_UIOnly, SetInputMode_GameAndUI, SetInputMode_GameOnly nodes to setup your desired behavior.
Game Only always locks.
In C++ you can call the:
function takes FInputModeUIOnly, FInputModeGameAndUI, FInputModeGameOnly, or your own custom class.
Here's a little tutorial I wrote based on Rama's code when I was asking the same question to myself.
answered Jun 23 '14 at 10:38 PM
Thank you for your report. We were not able to investigate this on the engine version you reported, but there have been many version changes to UE4 since this question was first posted. With a new version of the Engine comes new fixes and it is possible that this issue has changed or may no longer occur. Due to timetable of when this issue was first posted, we are marking this post as resolved for tracking purposes.
If you are still experiencing the issue you reported in the current engine version, then please respond to this message with additional information and we will investigate as soon as possible. If you are experiencing a similar, but different issue at this time, please submit a new report for it.
answered Oct 03 '14 at 02:38 PM
Looking at the declaration of the virtual void function "LockMouseToViewport(bool bLock)" in the UnrealClient.h file, there is no code to implement the function. As a virtual function it would be possible to override the function elsewhere with your own code functionality.
answered Jan 15 '15 at 09:34 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here