Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

readme.md

Implement Touch with the new Input System

This tutorial was created with Unity version 2019.4.

User input is a core pillar of an interactive and engaging experience. Once you collect it, it's important you present an experience that feels natural and intuitive to the player. In this tutorial, you'll cover the basics of the new Unity Input System by creating a demo project that can:

  • Place a 3D model by dragging it off the User Interface (UI) and dropping it into the world.
  • Move the camera by dragging one finger.
  • Zoom the camera by pinching two fingers.

Demo of Final Result

Learning Outcomes

You'll learn how to:

  • Install the new Input System's package.
  • Enable Touch Simulation mode.
  • Collect and process touch input via the EnhancedTouch API.
  • Route Input System events to the UI.

Prerequisites

  1. This tutorial assumes you already have basic knowledge of Unity and intermediate knowledge of C#.
  2. You need Unity 2019.4 or later to follow along with this tutorial.
  3. While you can enable simulation mode for testing, the behavior is unpredictable and only simulates a single touch. As a result, you also need a touch device to complete this tutorial.

Table of Contents

  1. Getting started
  2. Get the touch input
  3. Move the camera
  4. Zoom the camera
  5. Set up the UI for building placement
  6. Gather the building input
  7. Finish setting up the building UI
  8. Fix up the bugs and add some polish
  9. Challenge: Upgrade a placed building

Resources

  1. Comments, concerns and/or questions can be posted here.
  2. Check out How to make a configurable camera with the new Unity Input System if you want to learn more about Action Assets. You'll build the camera rig used in this tutorial from scratch.
  3. You can also check out Inventory and Store System - Part 3 (Creating the Store UI) for a deeper look at the UI system.
  4. Input System documentation and GitHub repository.
  5. The models in this tutorial are from What Up Games, LLC and the UI icons are from Game-Icons.net.