Challenge Solution - Extending the selection logic

Introduction

Last Update: Dec 10, 2019

challenge-solution unity input-system C# ui mouse-events

Project Files

This tutorial was created with Unity version 2019.2.

A challenge was issued at the end of the How to select multiple objects based on the center of a collider tutorial to extend the mechanic by adding the ability to add/remove objects from an existing selection and clear the selection with a button click. This tutorial walks through how I chose to solve that challenge.

Learning Outcomes

  1. Apply knowledge gained from the tutorial series.

Prerequisites

This is a continuation of the How to select multiple objects based on the center of a collider 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.

Demo of Final Result

Tutorials in this Series

  1. Part 1: How to make a configurable camera with the new Input System
  2. Part 2: Listen for the Input System Action events via CSharp
  3. Part 3: How to select multiple objects based on the center of a collider
  4. Part 4: Challenge Solution: Extending the selection logic

Resources

  1. This project uses the Low Poly: Free Pack by AxeyWorks.