Hi everyone!
I’m working on a TopDown Project but I want to restrict mouse area to a circle around my character. Any idea of how can I do this?
Thank you!
Hi everyone!
I’m working on a TopDown Project but I want to restrict mouse area to a circle around my character. Any idea of how can I do this?
Thank you!
You do not want to restrict mouse area, you probably want to restrict where marker is displayed. Both things are easy to do.
First get location of your character and location of mouse pointer in world space.
Substract both locations (mouse cursor loc - character location), you have vector. If length of this vector is less than some distance you do nothing, just display mouse pointer.
If length of that vector is more than distance you want, calculate unit vector out of it (use NORMALIZE node), then multiply that vector by max distance. And add to character world location.
Now you should have that circle around character.
If you want to RESTRICT mouse to some circle around character, just instead of snapping cursor to circle, do nothing ignore clicks outside circle.
Thank you! It works
Hello Can you paste your BP here? im trying to do this but can’t picture the BP you guys mentioned TY!
Actually, I’m not using this anymore with my project. I let the mouse being free and I give collision to background to fix when the mouse get out of the map. Sorry friend