Create a BP HUD class, called RTS_Marquee_HUD
Create a BP Controller, name as RTS_Player controller
Go Project setting, change the default setting
To make the rectangle for selection:
Transfer the graph nodes created from tutorial 1 from BP_TopDown Controller to RTS controller
Untick Hide Cursor During capture in set input mode game and UI node
Create a boolean variable, form the graph below:
Create a BP interface, called RTS_Interface
Name and add the function as follow
Add RTS interface in RTS PlayerController
Add follow to the graph
Go to RTS marquee HUD,
class setting, add RTS interface
Add below variables:
go to event graph and set as below:
For drawing rectangle (rect color set alpha 0.2, like transparent)
To make the drawing rectangle interact on targeted objects:
Go to RTS interface, add
Go to Parent Unit Class
Add RTS interface, set the graph
Go to HUD BP, extend the graph from Draw Rect node:
To make De-selection:
In HUD BP, add actor array variable