Home and Learn: Games Programming Course


Create a Unity 3D Scene using Free Game Assets

In the previous lesson, we created a new 3D game project with a simple Plane object. We then imported a first person controller so we could walk about. We also set up the cameras. However, it looks incredibly dull just walking around on a flat, grey plane. So let's download some free stuff from the Unity Asset Store.

 

Import Unity Game Assets

From the Window menu at the top of Unity, select Asset Store. Your browser will launch and take you to the Asset Store home page. From the 3D menu at the top of the store, select the Environments option. You'll get lots of results back with environments you can download. Most are ones you have to pay for, which is fine, if you can afford the price - there's some really great stuff on there. But look for the Pricing option. There should be a box you can check for Free Assets. Have a browse. The one we'll use is by 3DShapes and is called Colonial City LittlePack. It can be found here:

https://assetstore.unity.com/packages/3d/environments/urban/colonial-city-littlepack-163089

(Sometimes, creators will withdraw a free assets from the store. If the above pack is not available, download a free environment of your choosing. The advice below on magenta materials will still be valid, whichever environment you download. As will all the lessons in this entire section.)

On Assets Store web page, click the button to Add to my Assets. The Package Manager should open in Unity where you can download the asset:

Unity 3D Package Manager showing a game asset ready to download.

Once downloaded, you need to click the button to Import it into your project. Once imported, it should look like this in your project area at the bottom of Unity:

3D assets downloaded from the Unity Asset Store

However, double click the Materials folder and you may see this:

Unity 3D folder showing Materials not imported correctly

If you see assets that have turned magenta like this, it means Unity hasn't converted them properly to the Pipeline you're using (Universal Render Pipeline, for us).

 

How to Fix Magenta Materials in Unity

To fix the problem, SHIFT click to select all the materials. Then from the menus at the top of Unity, select Edit > Rendering > Materials > Convert Selected Built-in Materials to URP.

Converting materials to the Universal Render Pipeline in Unity 6, 3D

Once they are converted, the materials should look like this:

Materials converted to the Universal Render Pipeline in  Unity 6

To make sure that all the materials are applied to things like Prefabs, which we'll need, right click on a blank area inside of the materials folder. From the menu, select Reimport All:

Unity 6 menu with the Reimport All option selected

Unity will display a dialogue box asking if you're sure. You are, so click the Import button. Unity will restart. When it's up and running again, you should find that your materials and prefabs are all good.

Move inside of the following folder:

Assets/Colonial City LittlePack/Colonial_Graveyard/Prefabs/Graveyard

The Prefabs should look like this:

Unity 6 prefab folder showing materials applied correctly

(Don't worry if your streetlamp is still magenta.)

 

Creating a Unity Scene

To start creating a scene, drag and drop the Prefab called Graveyard_Ground into the main scene window (second from the left on the bottom row, in the image above). Drag and drop it onto your Plane. Increase the Scale of your Graveyard Ground. We made ours 7 for the X, and Z values. (Make sure the Position values are all 0.)

You can delete the Plane object from your Hierarchy.

Start with the Church. Drag and drop the prefab onto the Graveyard Ground. Change the scale of the Church, as it will be too small. We went with a value of 7 for the Scale X, Y, and Z.

Now move the church into position. You can see an area reserved for it at the bottom right of the Church Yard ground. We set the Position values in the Inspector for our church as 0.25 for the X, 0 for the Y, and -1.2 for the Z:

A 3D model in Unity Scene view

As you can see in the image above, there are 5 raised areas where you can add the grave prefabs. Drag and drop graves from the Graveyard Prefab folder onto the raised areas. This may take you some time but, as a solo developer, it's one of the many things you have to get used to doing for yourself. Here's ours, if you want something to copy (the white lines above are where the player and the camera are):

A graveyard scene using free game assets in Unity 6

To get walls surrounding your Graveyard, you can drag and drop one wall then, in the Hierarchy, duplicate the first wall. If you turn snapping on at the top of Unity, you can align the walls a lot better:

Unity 6 snapping for 3D model alignment

Click the dropdown arrow to set the grid settings:

Settings area for snapping in Unity 6 3D

For the Grid Size, where it says 1, try a value of 0.5 for the snapping. Now, when you move a wall with the blue, red, and green arrows in the scene, one wall will snap to another, depending on your settings. Remember to toggle the Grid off, if you don't need it, as the snapping can get annoying when trying to move other game objects.

After a of time, you'll have a scene that looks something like the one in the short video below:

 

Now that we have built a scene to walk around in, we can add a gun in our player's hand and start shooting!

<--Back to the Unity 3D Course Contents Page

 


Email us: enquiry at homeandlearn.co.uk