I’m making an update to this problem because i’m struggling with coordinates system and my HUD, which prevents me from finding the solution to this problem …
To recap what I did from start :
- I’m getting the centerpoint of my viewport ( used as the center of my circle )
- I’ve been creating a cursor ( from a HUD element, and i’m playing with its anchor point )
- I got a radius that is a variable ( supposed to be controled later )
- I’m setting up a vector called MouseVector ( vector from center of the screen to mouse position )
- I’m comparing the vector length of my “MouseVector” to the radius.
Basically that’s what I have so far :
- If my mouse is inside the circle, the cursor is set to my mouse position
- If my mouse is outside the circle, then i’m doing a projection of a the cursor on the edge of the circle
But i have some troubles with positions** in my viewport, some kind of offset with the anchor point of my cursor :
With a basic example, when my mouse is at the center of the viewport, the cursor is already there with an offset.
So i decided to do some “Print String” to check both positions ( mouse and cursor )
Numerically they are the same ( cursor = red / mouse = green )
I guess it’s coming from my HUD Blueprint :
But i’ve been trying to fix that for 2 days, and i’m not able to find a solution to that.
Can someone give me some help on that ?? I would really appreciate.
For those who want to give it a look:
( so that you can see what’s really happening )