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

Adding Mobile Support

So far, our character is able to move around with PC controls, that is with the W, A, S, D keys, Spacebar, mouse clicks, and so on. But you may ask, what about on a mobile device? Here we solve it. Fortunately, Unity offers us an easy solution to solve the character movement with touch controls.

Next, we will add a step by step system that allows us to make movements with our fingers. To do so, we will follow these steps:

  1. We must make some modifications in the PlayerInstance Prefab, double click on the Prefab located in Assets | Photon | PhotonUnityNetworking | Resources to edit it.
  2. Unity offers a Prefab that practically brings this system, it is called UI_Canvas_StarterAssetsInputs_Joysticks and we look for it in the path Assets | StarterAssets | Mobile | Prefabs | CanvasInputs and we drag it to the PlayerInstance Prefab.
    Figure 2.35 – Adding Mobile Controls Prefab

Figure 2.35 – Adding Mobile Controls Prefab

  1. Now, we select the UI_Canvas_StarterAssetsInputs_Joysticks...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Build Your Own Metaverse with Unity
Published in: Sep 2023Publisher: PacktISBN-13: 9781837631735

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