How to select multiple objects based on the center of a collider
Last Update: Oct 26, 2019
This tutorial was created with Unity version 2019.2.
Learn how to create an RTS/RPG “drag-to-select multiple characters” game mechanic without using raycasts to detect collisions. Instead, we’ll use the center point of the collider’s bounds to detect if it is within the radius of a panel drawn on the UI via the mouse start/end positions. This approach supports perspective camera setups and a can be altered to use any vector3 point.
This is a continuation of the Listen for the Input System Action events via CSharp tutorial, which is part two of the Input System series. You can skip previous tutorials by cloning the starterProject in the repository.
Note: This tutorial will not cover previous topics in depth (such as how the Input Manager works). It is recommended that you start from the beginning of the series if you are missing any concepts.