I would like a character to be selected with left click and reach a destination simply by pressing right click anywhere. (Not with “follow cursor” method, just click to go to a location). I have already a box selection by dragging but not a selection by a simple click on one character.
This was to show you what style of this game is it. To also say that the character moves with the selection rectangle but not with a selection by simple click. And for the sliding character, it’s because I haven’t linked the walking animation yet.
The first image is the controlled character.
The second and the third are the controller.
The fourth last ones are the hud-canvas for the rectangle selection.
If you just click, the start / end point of the rectangle are identical - the resulting array is probably empty (is it? - double check that). Also, I do not not see an implementation of what I suggested above anywhere here.
You may need 2 methods, for selecting groups and for selecting singular units.
Also, consider switching to the Enhanced Input early. Especially if you’re planing on achieving any level of complexity.
Incorporate what I originally posted; ideally a better version of it that is using Enhanced Input.
It’s more easy with the Enhanced input
It’s more difficult but, once learnt, it will allow you to accomplish what seems almost impossible with the old input method; which is now also considered legacy and may be phased out in the future.
Alternatively, you could get cheeky → if the rect points end up being identical, shift the end point by 1,1 thus making it a valid selection rectangle. You never confirmed what happens to the unique array when a singular click occurs. I am merely assuming that’s what happens - the array remains empty if the HUD’s rect is a singular point.