Reader small image

You're reading from  Build Your Own Metaverse with Unity

Product typeBook
Published inSep 2023
PublisherPackt
ISBN-139781837631735
Edition1st Edition
Tools
Concepts
Right arrow
Author (1)
David Cantón Nadales
David Cantón Nadales
author image
David Cantón Nadales

David Cantón Nadales, software engineer from Seville, Spain, with more than 15 years of experience. He is currently a Technical Leader at Grupo Viajes El Corte Inglés, a leading travel company in Europe. He has done a multitude of projects and video games with Unity, VR/AR with Oculus, Hololens, HTC Vive, DayDream and LeapMotion. He was ambassador of the Samsung community "Samsung Dev Spain", and organizer of "Google Developers Group Sevilla". He led more than 100 projects throughout his career. As a social entrepreneur stands out Grita, a social network that emerged during the confinement of COVID-19 that allowed to talk to other people and help each other psychologically. In 2022 he won the Top Developers Awards organized by Samsung.
Read more about David Cantón Nadales

Right arrow

Choosing an input handler

The Input Manager in Unity is the area where you define the keys or axes of the keyboard and mouse that will be detected when the user plays the game. These keys and axes can be related to a name and then accessed via code. For example, in one of our scripts, we can ask if the user has made a jump because they have pressed the spacebar.

A few years ago, Unity used an Input Manager system that is now obsolete due to the arrival of a new system called the new Input System.

Unity’s new Input System was created to unify the controls on PC, PlayStation, Xbox, and other systems.

Let’s start by adding the new Input System to our project:

  1. Open Package Manager. This can be found under Window | Package Manager:
Figure 1.23 – Locating the new Input System plugin in Package Manager

Figure 1.23 – Locating the new Input System plugin in Package Manager

  1. Change the source of Packages: In Project to Packages: Unity Registry (1).
  2. Scroll down the list and look for Input System (2) and click the Install button (3).
  3. Unity will display a warning that for the changes to activate the new Input System, the project must be restarted. Click the Yes button to restart the editor.

If you have unsaved changes in the scene, you will see a popup, warning you of this so that you can save it before the editor closes:

Figure 1.24 – Unity notice about applying changes to the project

Figure 1.24 – Unity notice about applying changes to the project

Note

You can find detailed information about the differences between the old and the new system at https://blog.unity.com/technology/introducing-the-new-input-system. This is recommended reading.

Perfect! Our project has been configured to work. Now, it’s time to get to know Firebase and learn about all the services that it offers.

Previous PageNext Page
You have been reading a chapter from
Build Your Own Metaverse with Unity
Published in: Sep 2023Publisher: PacktISBN-13: 9781837631735
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime

Author (1)

author image
David Cantón Nadales

David Cantón Nadales, software engineer from Seville, Spain, with more than 15 years of experience. He is currently a Technical Leader at Grupo Viajes El Corte Inglés, a leading travel company in Europe. He has done a multitude of projects and video games with Unity, VR/AR with Oculus, Hololens, HTC Vive, DayDream and LeapMotion. He was ambassador of the Samsung community "Samsung Dev Spain", and organizer of "Google Developers Group Sevilla". He led more than 100 projects throughout his career. As a social entrepreneur stands out Grita, a social network that emerged during the confinement of COVID-19 that allowed to talk to other people and help each other psychologically. In 2022 he won the Top Developers Awards organized by Samsung.
Read more about David Cantón Nadales