Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Unity 2022 Game Development - Third Edition

You're reading from  Hands-On Unity 2022 Game Development - Third Edition

Product type Book
Published in Oct 2022
Publisher Packt
ISBN-13 9781803236919
Pages 712 pages
Edition 3rd Edition
Languages
Author (1):
Nicolas Alejandro Borromeo Nicolas Alejandro Borromeo
Profile icon Nicolas Alejandro Borromeo

Table of Contents (23) Chapters

Preface 1. Creating a Unity Project 2. Editing Scenes and Game Objects 3. Grayboxing with Terrain and ProBuilder 4. Importing and Integrating Assets 5. Introduction to C# and Visual Scripting 6. Implementing Movement and Spawning 7. Physics Collisions and Health System 8. Win and Lose Conditions 9. Implementing Game AI for Building Enemies 10. Materials and Effects with URP and Shader Graph 11. Visual Effects with Particle Systems and Visual Effect Graph 12. Lighting Using the Universal Render Pipeline 13. Full-Screen Effects with Post-Processing 14. Sound and Music Integration 15. User Interface Design 16. Creating a UI with the UI Toolkit 17. Creating Animations with Animator, Cinemachine, and Timeline 18. Optimization with Profiler, Frame Debugger, and Memory Profiler 19. Generating and Debugging an Executable 20. Augmented Reality in Unity 21. Other Books You May Enjoy
22. Index

Importing and Integrating Assets

In the previous chapter, we created the prototype of our level. Now, let’s suppose that we have coded the game and tested it, confirming the game idea is fun. With that, it’s time to replace the prototype art with the real finished art. We are going to actually code the game in the next chapter, Chapter 5, Introduction to C# and Visual Scripting, but for learning purposes, let’s just skip that part for now. In order to use the final assets, we need to learn how to get them (images, 3D models, and so on), how to import them into Unity, and how to integrate them into our scene.

In this chapter, we will examine the following topics:

  • Importing assets
  • Integrating assets
  • Configuring assets

Let’s start by learning how to get assets in Unity, such as 3D models and textures.

Importing assets

We have different sources of assets we can use in our project. We can simply receive a file from our artist, download them from different free and paid assets sites, or we can use the Asset Store, Unity’s official asset virtual store, where we can get free and paid assets ready to use with Unity. We will use a mix of downloading assets from the internet and from the Asset Store, just to use all possible resources.

In this section, we will cover the following concepts related to importing assets:

  • Importing assets from the internet
  • Importing assets from the Asset Store
  • Importing assets from Unity Packages
  • Let’s start by exploring the first source of assets, the internet.

Importing assets from the internet

In terms of getting art assets for our project, let’s start with our terrain textures. Remember that we have our terrain painted with a grid pattern, so the idea is to replace that with grass, mud,...

Integrating assets

We have just imported lots of files that can be used in several ways, so the idea of this section is to see how Unity integrates those assets with the GameObjects and components that need them.

In this section, we will cover the following concepts related to importing assets:

  • Integrating terrain textures
  • Integrating meshes
  • Integrating materials

Let’s start by using the tileable textures to cover the terrain.

Integrating terrain textures

In order to apply textures to our terrain, do the following:

  1. Select the Terrain object.
  2. In the Inspector, click the brush icon of the Terrain component (second button).
  3. From the drop-down menu, select Paint Texture:

Figure 4.17: Terrain Paint Texture option

  1. Click the Edit Terrain Layers… | Create Layer option.
  2. Find and double-click the terrain texture you downloaded previously in the Texture Picker window that appears...

Configuring assets

As we mentioned earlier, artists are used to creating art assets outside Unity, and that can cause differences between how the asset is seen from that tool and how Unity will import it. As an example, 3D Studio Max can work in centimeters, inches, and so on, while Unity works in meters. We have just downloaded and used lots of assets, but we have skipped the configuration step to solve those discrepancies, so let’s take a look at this now.

In this section, we will cover the following concepts related to importing assets:

  • Configuring meshes
  • Configuring textures

Let’s start by discussing how to configure 3D meshes.

Configuring meshes

In order to change the model’s import settings, you need to locate the model file you have downloaded. There are several file extensions that contain 3D models, with the most common one being the .fbx file, but you can encounter others such as .obj,.3ds, .blender, .mb, and so...

Summary

In this chapter, we learned how to import models and textures and integrate them into our scene. We discussed how to apply textures to the terrain, how to replace our prototype mesh with modular models, how to apply textures to those, and how to properly configure the assets, all while taking several criteria into account according to the usage of the object.

With this, we have finished Part 1 of this book and discussed several basic Unity concepts we will use throughout the book. In Part 2, we will start coding the gameplay of our game, like the player’s movement and the health system. We will start learning how to create our own components to add behavior to our objects and the basic anatomy of a script.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Hands-On Unity 2022 Game Development - Third Edition
Published in: Oct 2022 Publisher: Packt ISBN-13: 9781803236919
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.
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 $15.99/month. Cancel anytime}