I know this is probably super simple and been asked a few times, but I can’t quite find anything about my exact symptoms. I’m just trying to draw a simple rectangle to select actors in the level, like in an RTS.
This is in my player controller BP. EnhancedInputAction IA_SelectBegin’s Triggered pin fires when I click LMB. The triggered pin on the EnhancedInputAction IA_SelectEnd fires when I release LMB, and the Ongoign pin fires when I am holding LMB down.
The end result is that when I just click on the screen, a black rectangle of arbitrary dimensions appears. The closer I click to the top left corner, the smaller it is. If I try to drag the mouse, the rectangle jitters a bit but I can’t make it significantly larger or smaller and it snaps back to its original size. I have debugged by printing the mouse coordinates on the screen and found that while I am dragging it, no matter how far away I move, it constantly reverts back to the point where I initially clicked.
Ofcourse if you are talking about top down, either you can make a new render aligned to camera or simply you can draw a transparent plane in the world. Also just in case want to mention that selection will need to match your world so you can select the units.
There are couple of ways to do that for prototype or more advanced methods, like projecting on to a topology or a complex shape, some of them render based (mesh , decal , shader) some of them object based (which is better in some terms since selection also can be done at the same time) so there are mix of methods if you want AAA ones however at some point C++ required. Think we can do with geometry scripts too a simple one. Let us know.
triggered is usually called on tick so you’re constantly updating the mouse position start. you dont need the hold at all since DrawHUD is also called on tick so you can move the bool there and get mousepositionend there too