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  Game Development - Fourth Edition

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

Product type Book
Published in Jan 2024
Publisher Packt
ISBN-13 9781835085714
Pages 742 pages
Edition 4th Edition
Languages
Authors (2):
Nicolas Alejandro Borromeo Nicolas Alejandro Borromeo
Profile icon Nicolas Alejandro Borromeo
Juan Gabriel Gomila Salas Juan Gabriel Gomila Salas
Profile icon Juan Gabriel Gomila Salas
View More author details

Table of Contents (28) Chapters

Preface 1. Section 1: Getting Started with Unity
2. Embark on Your Unity Journey 3. Crafting Scenes and Game Elements 4. From Blueprint to Reality: Building with Terrain and ProBuilder 5. Seamless Integration: Importing and Integrating Assets 6. Section 2: Mastering Programming and Gameplay Mechanics
7. Unleashing the Power of C# and Visual Scripting 8. Dynamic Motion: Implementing Movement and Spawning 9. Collisions and Health: Detecting Collisions Accurately 10. Victory or Defeat: Win and Lose Conditions 11. Starting Your AI Journey: Building Intelligent Enemies for Your Game 12. Section 3: Elevating Visuals, Effects, and Audio
13. Material Alchemy: Using URP and Shader Graph for Stunning Visuals 14. Captivating Visual Effects: Harnessing Particle Systems and Visual Effect Graph 15. Enlightening Worlds: Illuminating Scenes with the Universal Render Pipeline 16. Immersive Realism: Achieving Fullscreen Effects with Post-Processing 17. Harmonious Soundscapes: Integrating Audio and Music 18. Section 4: Designing User Interfaces, Animations and Advanced Concepts
19. Interface Brilliance: Designing User-Friendly UI 20. Next-Gen UI: Creating Dynamic Interfaces with UI Toolkit 21. Animated Realities: Creating Animations with Animator, Cinemachine, and Timeline 22. Performance Wizardry: Optimizing Your Game with Profiler Tools 23. From Prototype to Executable: Generating and Debugging Your Game 24. AR/VR 25. Massive Worlds: Introduction to DOTS 26. Other Books You May Enjoy
27. Index

Seamless Integration: Importing and Integrating Assets

In the previous chapter, we created a 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, Unleashing the Power of 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 asset sites or 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, rock, and other...

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 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.15: 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 an 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 on...

Join our book community on Discord

https://packt.link/unitydev

A qr code with black squares Description automatically generated

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, Unleashing the Power of 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.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Hands-On Unity Game Development - Fourth Edition
Published in: Jan 2024 Publisher: Packt ISBN-13: 9781835085714
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 €14.99/month. Cancel anytime}