Reader small image

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

Product typeBook
Published inJan 2024
PublisherPackt
ISBN-139781835085714
Edition4th Edition
Tools
Right arrow
Authors (2):
Nicolas Alejandro Borromeo
Nicolas Alejandro Borromeo
author image
Nicolas Alejandro Borromeo

Nicolas is a Game Developer currently working as a Senior Software Development Consultant for Unity in London. He is a Unity Certified Instructor teaching Unity clients all around the globe. He started using Unity in 2008 and teaching it in 2012 in several Universities and Education Institutes.
Read more about Nicolas Alejandro Borromeo

Juan Gabriel Gomila Salas
Juan Gabriel Gomila Salas
author image
Juan Gabriel Gomila Salas

Juan graduated in mathematics with a master's degree in Teacher Training, specializing in Game Design for social casino video games and as a video game developer using Unity and Unreal Engine for both PC and mobile. He was an online teacher on Udemy from 2015 to 2022 and subsequently on his own platform Frogames Training with over 150 online courses and over 500,000 students across 130 countries.
Read more about Juan Gabriel Gomila Salas

View More author details
Right arrow

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 2024Publisher: PacktISBN-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.
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 €14.99/month. Cancel anytime

Authors (2)

author image
Nicolas Alejandro Borromeo

Nicolas is a Game Developer currently working as a Senior Software Development Consultant for Unity in London. He is a Unity Certified Instructor teaching Unity clients all around the globe. He started using Unity in 2008 and teaching it in 2012 in several Universities and Education Institutes.
Read more about Nicolas Alejandro Borromeo

author image
Juan Gabriel Gomila Salas

Juan graduated in mathematics with a master's degree in Teacher Training, specializing in Game Design for social casino video games and as a video game developer using Unity and Unreal Engine for both PC and mobile. He was an online teacher on Udemy from 2015 to 2022 and subsequently on his own platform Frogames Training with over 150 online courses and over 500,000 students across 130 countries.
Read more about Juan Gabriel Gomila Salas