Lasso drag select multiple objects multi-select group

I would like the player to be able to draw a rectangle to select multiple game objects, like selecting a bunch of soldiers in your army in an RPG like Age of Empires.

The selected game objects might show a “selected” highlight and could then be moved all at once by dragging one of the items in the group.

I have not seen an example like this. I did find an example of drawing a rectangle but I am surprised I can’t find a “select sprites” or “drag select” example.

There is a new example that could help you.

Thanks, that within variable is the key!