Book Image

Unity 2022 Mobile Game Development - Third Edition

By : John P. Doran
Book Image

Unity 2022 Mobile Game Development - Third Edition

By: John P. Doran

Overview of this book

Unity is a well-established player in the mobile game development sphere, and its new release, Unity 2022, is packed with new, exciting features. In Unity 2022 Mobile Game Development, Third Edition, you'll get to grips with the Unity game engine by building a mobile game and publishing it on the most popular mobile app stores as well as exploring the all-new features. This book provides a comprehensive and practical approach to mobile game development, helping you build an endless runner game. Starting with setting up a simple Unity project for mobile development, you’ll delve into various essential aspects needed to successfully create and publish your game. You’ll acquire a range of skills, such as incorporating touch gestures, monetizing your game with Unity Ads and in-app purchases, designing an intuitive UI, and seamlessly integrating social media functionalities. Additionally, you’ll gain valuable insights into player preferences and behavior using Unity's analytics tools. You’ll also explore features of augmented reality in Unity 2022, enhancing your game's appeal. By the end of this book, you’ll be well-equipped to reap the power of Unity 2022 to build, optimize, and publish robust cross-platform mobile games with C#, as well as widening your skill set and enhancing your credentials as a game developer.
Table of Contents (21 chapters)
1
Part 1: Gameplay/Development Setup
4
Part 2: Mobile-Specific Features
11
Part 3: Game Feel/Polish

Building Your Game

As we start on our journey of building mobile games using the Unity game engine, it’s important that you are familiar with the engine itself before we dive into the specifics of building things for mobile platforms. Although there is a chance that you’ve already built a game and want to transition it to mobile, there will also be those of you who haven’t touched Unity before or may not have used it in a long time. This chapter will act as an introduction to newcomers and a refresher for those coming back, and it will provide some best practices for those who are already familiar with Unity. While you may skip this chapter if you’re already familiar with Unity, I think it’s also a good idea to go through the project so that you know the thought processes behind why the project is made in the way that it is, so that you can keep it in mind for your own future titles.

In this chapter, we will build a 3D endless runner game in the same vein as Imangi Studios LLC’s Temple Run series. In our case, we will have a player who will run continuously in a certain direction and dodge the obstacles that are in their way. We can also add additional features to the game easily, as the game will endlessly have new things added to it.

This chapter will be split into several topics. It will contain simple, step-by-step processes for you to follow. Here is an outline of our tasks:

  • Setting up the project
  • Creating the player
  • Moving the player through a C# script
  • Improving scripts using attributes and XML comments
  • Update function versus FixedUpdate function
  • Having the camera follow our player
  • Creating a basic tile
  • Making the game endless
  • Creating obstacles