Accesing mouse position/coordinates in C++
I have set up my mouse control according to this tutorial.
Great, except the tutorial finishes off with "When you play the map, you should now see the cursor. However, unless you have set up some sort of behavior (via C++ code or Blueprint), you will get no responses at this time" and is completely unhelpful in giving me hints on where to start with that.
What I wanna know is, how can I access my new class from my C++ pawn code and get and use the mouse coordinates? Getting them in 2D vector form would be ideal, but anything goes. As my project develops I will need to implement for complex mouse uses but for now I just need a starting point.
Can anyone help me please? Thanks!
asked Dec 12 '15 at 05:25 AM in C++ Programming
You'll want to use the GetMousePosition() method of the Player Controller. Here's a simple example, where there is only a single PlayerController in the world:
You'll need these two libraries included in your .cpp file:
answered Apr 13 '18 at 05:32 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here