Assets & Prefabs
This section explains how Unity handles external files, reusable objects, and visual appearance through materials and shaders.
Importing Assets
Assets are any external files used by your project such as models, textures, audio, scripts, and animations.
They are the building blocks of your game.
Correct importing ensures models scale properly, textures look correct, and animations play as expected.
Importing steps:
-
Drag files directly into the Assets folder.
-
Or use Assets → Import New Asset.
-
Unity automatically imports and converts files.
After importing, the asset appears in the Project window.
Clicking an asset shows import settings in the Inspector.
Warning:
-
Avoid importing assets into random folders. Organize first.
-
Large textures and models increase build size.
-
Reimport if changes were made outside Unity.
- If you want to move or rename assets in your project, do it in the Project window, since Unity will then take care of it's
.metafile as well.
Further Reading:
https://docs.unity3d.com/Manual/ImportingAssets.html
Prefab System
A Prefab is a reusable GameObject saved as an asset.
It stores:
-
Components
-
Values
-
Child objects
-
Hierarchy structure
You can place the same Prefab into multiple scenes or multiple times in one scene.
How-to:
Creating a Prefab
-
Drag a GameObject from Hierarchy into Project window.
Using a Prefab
-
Drag prefab from Project window into Scene.
Editing a Prefab
-
Double-click prefab → Prefab Mode.
-
Modify components → Save.
Applying Changes
-
Modify instance → Inspector → Overrides → Apply.
Prefabs prevent duplication and inconsistency.
Changing one prefab can update hundreds of instances.
Warning:
-
Editing instance ≠ editing prefab.
-
Often mistake is to forget to Apply changes to.
Further Reading:
https://docs.unity3d.com/Manual/Prefabs.html
Materials
A Material defines how a surface of a shape looks.
They define how that shape interacts with light i.e. is it shiny like chrome, dull like rubber, or transparent like glass?
Materials control:
-
Color
-
Texture
-
Smoothness
-
Metallic value
-
Transparency
Materials are assigned to Mesh Renderer components.
How-to:
Create
-
Right-click in your Project Window → Create → Material.
Assign
-
Drag the Material from the Project window directly onto an object in the Scene view or onto the Mesh Renderer component in the Inspector.
Edit
-
Select the Material to adjust its properties in the Inspector.
Practical Settings
Most of your work will probably happen within these five main properties:
-
Surface Inputs (Albedo): The base color or texture of the object. Click the color picker or assign an image (Texture) here.
-
Metallic: A slider from 0 to 1.
-
0: Non-metal (wood, plastic, cloth).
-
1: Pure metal (gold, iron, aluminum).
-
-
Smoothness: Controls how "blurry" reflections are.
-
0: Rough/Matte (sandpaper).
-
1: Mirror-like (polished marble)
-
-
Normal Map: This is a "fake" way to add bumps and scratches without adding more 3D geometry. It uses a blue/purple texture to tell light how to bounce off a flat surface.
-
Emission: Makes the material appear to glow. Great for computer screens or neon lights.
Furthermore, if your brick texture looks too big or stretched, use the Tiling settings at the bottom of the Material Inspector.
-
Tiling (2, 2): Repeats the texture twice across the surface.
-
Offset: Slides the texture along the surface.
Tip
If you have 100 rocks, try to make them use the same Material. Unity is much faster at rendering 100 objects with 1 material than 100 objects with 100 unique materials (this is called Batching).
Further Reading:
https://docs.unity.com/en-us/unity-studio/develop/materials/materials-intro
Shaders
A Shader controls how Unity renders a material.
In URP projects, common shader: Universal Render Pipeline/Lit.
Materials reference shaders.
Warning:
-
Wrong shader → pink materials.
Switch material shader between Lit and Unlit, to observe lighting difference.
Shader Graph enables you to build shaders visually.
When importing models that include materials, you may need to change the material’s shader to a URP-compatible shader (such as URP/Lit) to prevent the material from appearing pink.
Further Reading:
https://docs.unity3d.com/Packages/com.unity.shadergraph@17.5/manual/index.html