Game Assets *********** If you use Unity 3D primitives, you should obtain a rendering similar to the following: .. image:: forest.png This result is already very good and perfectly suitable for our projects. However, in order to introduce some variety, we will show how to integrate external assets. To do so, a few rules must be followed: - Do not use resources extracted from existing projects found on the internet or on GitHub... - Do not use resources from the Unity Asset Store - Prefer low-poly assets whenever possible - All asset packs used must be properly credited - No organic assets (animals, humans, monsters), in short anything that requires animation **We strongly discourage the use of the Unity Asset Store**. Assets obtained from it are often difficult to manage, may include hidden dependencies, are frequently very large (sometimes several hundreds of megabytes), and can easily become distracting and time-consuming. In short, for beginners, it is not necessarily a good starting point. Opengameart.org =============== This website is a good starting point. We can find many modular asset packs used to build 3D environments: - Select : Browse > 3D art .. image:: opengameart.png - Use the search to search by name of object or artist .. image:: search.png :scale: 65% Recommended Asset Packs ======================= `Modular Dungeon 2 - 3D Models - By Keith `_ --------------------------------------------------------------------------------------------------------- .. image:: dungon.png :align: center `Modular Village - By Keith `_ ------------------------------------------------------------------------------- .. image:: modularvillage.png :align: center `Modular Terrain - By Keith `_ ------------------------------------------------------------------------------- .. image:: modularterrain.png :align: center `Vehicles assets - By eracoon `_ ------------------------------------------------------------------------------------- .. image:: vehicle.png :align: center `3D Nature pack - By Kenney `_ ------------------------------------------------------------------------------ .. image:: 3Dnature.png :align: center `Furniture Kit - By Kenney `_ ---------------------------------------------------------------------------- .. image:: FurnitureKit.png :align: center `Marble Kit - By Kenney `_ ---------------------------------------------------------------------- .. image:: marblekit.png :align: center `Racing Kit - By Kenney `_ ---------------------------------------------------------------------- .. image:: circuit.png :align: center `Nature Kit - By Kenney `_ ---------------------------------------------------------------------- .. image:: naturekit.png :align: center `Medieval village megakit - By quaternius `_ ------------------------------------------------------------------------------------------------------ .. image:: medieval.png :align: center `Dungeon Pack - By KayKit `_ ------------------------------------------------------------------------------------ .. image:: kitkat.png :align: center Importing Assets ================ For this example we use: `Modular Terrain - By Keith `_ .. image:: modularterrain.png :align: center - Follow the link to the modular terrain pack - Download it, extract it .. image:: folders.png - Copy the three folders into your Unity *Assets* folder .. image:: unit.png - Enter folders and click on the prefab to preview objects .. image:: browse.png - Find the **Sand_Flat** prefab and put it in the scene, it is basically a cube - Scale it to 50x50 to obtain a large ground .. image:: sol.png This object has no collider. As a result, objects placed on it will fall through and must be manually vertically adjusted. To fix this and allow objects to rest correctly on the ground, add a Box Collider. - Add a box collider to the ground - Drag and drop some prefab and create your first scene .. image:: scene.png Import Issues ============= Importing an asset package is often problematic. Many issues can arise and usually need to be fixed manually. For example, you may encounter: - Missing texture/material - Broken link to the texture/material - Holes in geometry - Missing collider - Incorrect scale - Incorrect normals - Missing UV mapping - Duplicate materials - Excessively high polygon count - Incorrect object orientation - Single mesh (doors merged with the house) - ... In the previous exemple, we notice that there was no collider in the prefabs. We will now correct this issue: - Drag and drop the **Prop_Tree_Palm** prefab into the scene - Expand its hierarchy in the Hierarchy panel .. image:: palm.png - Select the different elements of the palm tree and check that none of them has a collider At this point, without any collider, this tree will behave like a ghost object in the scene: the player can walk through it. To solve this issue, we will select the tree trunk and add colliders to it. - Select the Translation Tool - By shift-clicking, select all the elements of the trunk .. image:: trunk.png - In the Inspector panel, click on **Add component** and select **Box collider**. This way, each part of the trunk receives a collider: .. image:: trunk2.png .. note:: If you need a more precise collider that follows the shape of the object, prefer using a Mesh Collider (with convex option activated). However, be aware that it is much more expensive. - Create a new asset folder named: fixedPrefab - Select the parent node: Prop_Tree_Palm_1 - Drag and drop it into the new folder to create an updated prefab This way, we fix a 3D prefab that had no collider and create an updated prefab. .. warning:: This process should be done for every component you use, so it may take some time.