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

Preface

Welcome to a world of infinite possibilities, where reality and imagination converge in a digital ether. This book is an invitation to explore the fascinating universe of metaverses and virtual worlds, a window into a new era of interaction and creativity.

At the heart of this technological odyssey is Unity, the platform that has revolutionized the creation of interactive experiences. With its powerful and versatile tools, Unity has enabled developers to bring to life unimaginable worlds and dreams that transcend the boundaries of the tangible.

The purpose of this book is to guide you through the exciting journey of building metaverses and virtual worlds, equipping you with the skills and knowledge you need to shape your own digital realities. From the fundamentals to advanced techniques, we will take you by the hand on this journey of discovery and learning.

But a world is not complete if it is not populated by beings, by presences that inhabit it and give life to its corners. This is where Firebase comes in. By integrating Firebase services into your creations, you will be giving your metaverses the intelligence and connectivity needed to create dynamic and personalized experiences. Firebase is the thread that will allow you to weave the web of interactions between users, the bridge that links their actions and gives them a unique and unforgettable experience.

However, the magic of a truly captivating metaverse is at its best when it is shared with others. This is where Photon, with its powerful network SDK, takes over. Through Photon, your creations come to life in the multiplayer realm, connecting people from all over the world and giving you the ability to share experiences, emotions, and adventures as if you were face to face.

With this guide in your hands, you will challenge the boundaries of conventional reality and venture into a territory without borders. This book is a map that will lead you to explore the vast universe of metaverses and virtual worlds, but it is you who will determine the course and magnitude of your creations.

So, take a seat on the ship of creativity and get ready for a journey that will challenge your imagination, sharpen your skills, and, above all, open the door to a new dimension, where the possibilities are endless.

What will you learn on this fascinating journey?

  • The fundamental concepts of metaverses and virtual worlds
  • How to plan and design an engaging and captivating metaverse
  • Using Unity to build realistic and immersive virtual environments and scenarios
  • Implement impressive and dynamic visual effects in the metaverse
  • Leverage Firebase’s capabilities to create authentication and data storage systems for a personalized user experience
  • Integrate and synchronize data between devices using Firebase Cloud Firestore
  • Develop game mechanics for meaningful interactions in the metaverse
  • Use Photon to implement multiplayer, chat, and voice chat functionality, allowing users to share their experience with friends and other online players
  • Optimize the performance of the metaverse to provide a smooth and efficient experience
  • Resolve common problems and debug bugs in the creation of virtual worlds
  • Ethical and security considerations in the development and deployment of metaverses and virtual worlds
  • Integrate the Oculus SDK to export your project and run it on Meta Quest 2 goggles

This book is designed to take you from the basics to advanced levels of creation and development, allowing you to explore new frontiers in the age of metaverses and open up endless possibilities for creativity and innovation.

Get ready to embark on an exciting journey of knowledge and skill in building digital universes that transcend the imagination!

Who this book is for

This book is designed especially for you, a game developer or programmer who wants to enter the exciting world of metaverses and virtual worlds using Unity, Firebase, and Photon. If you are a student or apprentice interested in learning about advanced technologies for creating immersive, multiplayer experiences, you will find this book a valuable guide.

If you are a designer or creative artist, you will be able to expand your skills in creating stunning and immersive virtual environments. If you work in the field of Virtual Reality (VR) or Augmented Reality (AR), you will discover how to build virtual worlds for these technologies and how to implement multiplayer interactions.

If you are a tech entrepreneur with a business vision, you will understand the emerging trends in metaverses to develop new projects or start-ups. Even if you are a technology and video game enthusiast interested in creating video games or virtual worlds, this book will give you technical knowledge and a deeper insight into the creative process.

What this book covers

Chapter 1, Getting Started with Unity and Firebase, lays the foundations of the knowledge necessary to work with Unity 3D. You will learn in depth about all that the Firebase suite offers and you will create your first scene.

Chapter 2, Preparing Our Player, teaches you how to create a 3D character fully controllable by you, for both desktop and mobile platforms. We will also see how to download new appearances and movements in Mixamo.

Chapter 3, Preparing Our Home Sweet Home: Part 1, is where we will design a beautiful virtual village with houses, pavements, trees, and buildings, a perfect setting to welcome the players of our metaverse.

Chapter 4, Preparing our Home Sweet Home: Part 2, teaches you how to optimize the scene built in the previous chapter to guarantee good performance for your players. We will also make our first foray into the Firebase Firestore database.

Chapter 5, Preparing a New World for Travel, helps you build a world with houses created and connected to the Firestore database. This scene will have the capacity to load, in real time and in a totally dynamic way, existing buildings in the database.

Chapter 6, Adding a Registration and Login Form for Our Users, provides an identification service for users, who will be able to log in or create a new account, through screens designed with the Unity GUI. Firebase Authentication will be the protagonist in this chapter.

Chapter 7, Building an NPC That Allows Us to Travel, helps you create a nice, animated Non-Player Character (NPC) who will provide us with a travel service between worlds.

Chapter 8, Acquiring a House, teaches you how to program a script that allows players to obtain a house. We will connect the owner with their building purchased on Firestore.

Chapter 9, Turning Our World into a Multiplayer Room, gives us the necessary knowledge to turn our metaverse into a multiplayer world, using Photon SDK to do so.

Chapter 10, Adding Text and a Voice Chat to the Room, to perfectly complement a multiplayer world, covers how to add a text chat and a voice chat, which will allow players to communicate in real time.

Chapter 11, Creating an NPC that Allows Us to Change Our Appearance, will provide the knowledge necessary to create a new NPC that will allow the player to change their avatar.

Chapter 12, Streaming Video like a Cinema, teaches you how to play streaming videos on a cinema-style screen.

Chapter 13, Adding Compatibility for the Meta Quest 2, as metaverses and VR are concepts that go hand in hand, covers how to convert the project to run on your Meta Quest 2 glasses.

Chapter 14, Distributing, will teach you how to compile our project for platforms such as Windows, Linux, Mac, Android, and iOS, as well as extra tricks for further performance optimization.

To get the most out of this book

Throughout this book, we will work within the Unity 3D game engine, which you can download from https://unity.com/download. The projects were created using Unity 2021.3.14f1, but minimal changes should be required if you’re using future versions of the engine.

If there is a new version out and you would like to download the exact version used in this book, you can visit Unity’s download archive at https://unity3d.com/get-unity/download/archive. You can also find the system requirements for Unity at https://docs.unity3d.com/2022.1/Documentation/Manual/system-requirements.html in the Unity Editor system requirements section.

To deploy your project, you will need an Android or iOS device. For the sake of simplicity, we will assume that you are working on a Windows-powered computer when developing for Android and a Macintosh computer when developing for iOS.

Software/hardware covered in the book

Operating system requirements

Unity 2021.3.14f1

Windows, macOS, or Linux

Unity Hub 3.3.1

Windows, macOS, or Linux

Meta Quest 2 (optional)

Android

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Build-Your-Own-Metaverse-with-Unity. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book. Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “This gives us the code needed – in particular, the GameNotificationManager class – to be added to our script.”

A block of code is set as follows:

public void ShowNotification(string title, string body,
                                DateTime deliveryTime)
{
    IGameNotification notification =
    notificationsManager.CreateNotification();
    if (notification != null)

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

    {
        notification.Title = title;
        notification.Body = body;
        notification.DeliveryTime = deliveryTime;
        notification.SmallIcon = "icon_0";
        notification.LargeIcon = "icon_1";

Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Once open, click the Continue button and follow the initial setup process.”

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at customercare@packtpub.com and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packtpub.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you’ve read Build Your Own Metaverse with Unity, we’d love to hear your thoughts! Please select https://www.amazon.in/review/create-review/error?asin=1837631735 for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

  1. Scan the QR code or visit the link below

https://packt.link/free-ebook/9781837631735

  1. Submit your proof of purchase
  2. That’s it! We’ll send your free PDF and other benefits to your email directly
lock icon
The rest of the chapter is locked
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