How could I Set mouse position via Blueprint?
I want to create WoW-like mouse look system. Hide mouse, disable mouse click events and rotate character while holding right mouse button. The problem is if I disable the mouse cursor it still move around. So when you press the right mouse button, the mouse disappears and you can rotate the camera. But when you release the right mouse button the mouse appears at a different location. There is one topic about that problem Link , but the solution is in c++ . Any suggestions how to solve this problem via Blueprint? (i found only "get mouse position" node)
I got it to work using a combination of Blueprints and C++ by doing the following:
I created a new C++ class called MyPlayerController to inherit from the default PlayerController class.
I added the following function to MyPlayerController using the code from your link above:
Then I went back to my Controller blueprint and used File->Reparent Blueprint to change the parent class to MyPlayerController. Now my new function: SetMousePosition is available in the controller blueprint and I can finish my WoW-like mouse look functionality.
I have only be using UE4 for 3 days, but I have a feeling this might be the trick to getting a lot of stuff to work. Instead of using the default classes, create your own versions in C++ and then you can expose additional functionality to the blueprints :)
answered May 08 '14 at 06:15 PM
What type of Blueprint are you attempting this in, try doing it in a Controller Blueprint.
You could do something like this:
There is probably other ways to do it, but this should get you started with some ideas.
answered Apr 30 '14 at 01:45 PM
DizzyWes ♦♦ STAFF
Dont think there is anyway in standard unreal at the moment but Rama have a node for it in his plugin.
~~~ ViewPort & Mouse Cursor ~~~
The Set/Get Mouse Position nodes work directly with the player's viewport, and do not require access to the HUD canvas.
~ Set Mouse Position - SET the mouse position to any values of your choosing!
~ Get Mouse Position - Get the current mouse position, will be consistent with results of SET Mouse Position
~ Get Center Of Viewport - Obtain the coordinates of the center of the viewport! Works in PIE as well as standalone game instances
For more info checkout the forum post about it https://forums.unrealengine.com/showthread.php?3851-(39)-Rama-s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required!
This code works as of UE4 4.13
answered Nov 05 '16 at 09:29 PM
I found a way around this by SetMousePosition to the same position it's currently at.
This section of blueprint was run off of a Sequence after an EventTick node. Checking for player distance to the intractable object that the cursor is over. Hope this helps someone. :)
answered Nov 30 '18 at 06:25 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here