Unity Basics
  • Welcome
  • Getting Started with Unity Software
  • Helpful Shortcuts
  • The Unity Software Interface
    • The Default Interface
    • The Windows (Tabs)
      • Hierarchy Window
      • Scene Window
      • Project Window
      • Inspector Window
      • Game Window
      • Console Window
    • Other Layouts
      • Create a Custom Layout
  • Create
    • Creating Game Objects
      • 3D Primitives
      • Creating Game Objects in the Editor
      • Spawning Objects
      • Unhiding/Hiding Objects During Gameplay
      • Parenting
    • Creating Assets
    • Creating Components and Scripts
      • Adding Components in the Inspector
      • Creating Custom Components and Scripts
    • Creating Prefabs
  • Select and Update
    • General Selection
    • Search and Focus
    • Updating Game Objects
      • Updating Game Objects in the Editor
      • Updating Prefabs
    • Updating Assets
    • Updating Components
      • Update Components in the Inspector
      • Accessing Components Through Scripts
  • Delete
    • Deleting Game Objects
      • Deleting and Disabling Objects in the Editor
      • Using the Destroy() Function
    • Deleting Components and Scripts
      • Disabling and Removing Components in the Editor
      • Disabling and Removing Components During Gameplay
  • Translate, Rotate, and Scale
    • Intro to Transforms
    • Handy Transform Shortcuts
    • Translate
      • Positioning Game Objects in the Editor
      • Updating Position Through Script Code
      • Using the Transform.Translate() Function
    • Rotate
      • Rotating Game Objects in the Editor
      • Updating Rotation Through Script Code
      • Using the Transform.Rotate() Function
    • Scale
      • Resizing/Scaling Objects in the Editor
      • Updating Scale Through Script Code
    • Controlling Speed
    • Common Issues with Transforms
  • Materials
    • Material Basics
      • Creating and Applying Materials
      • Accessing Materials Through Code
  • Physics
    • Physics Basics
    • Colliders and Triggers
      • Collider Component Overview
      • Accessing Colliders Through Scripts
      • Common Issues: Colliders and Triggers
    • Rigidbody Component
      • Rigidbody Component Overview
      • Accessing the Rigidbody Component Through Scripts
      • Common Issues: Rigidbody Components
    • Common Issues: Physics and Velocity
  • Interaction
    • Interaction Basics
    • Keyboard Controls
    • Mouse Controls
  • Coding Basics
    • Intro to Scripts
    • Variables
    • Conditionals (If / Then / Else)
    • Arrays
    • Loops
    • Functions
Powered by GitBook
On this page
  • Creating a Material Asset
  • Applying the Material
  • Common Properties to Play With
  • Color
  • Textures
  • Emission
  • Metallic
  • Normal and Height Maps
  • Occlusion
  • Tiling and Offset
  • Rendering Mode
  • Shaders

Was this helpful?

  1. Materials
  2. Material Basics

Creating and Applying Materials

PreviousMaterial BasicsNextAccessing Materials Through Code

Last updated 4 years ago

Was this helpful?

Creating a Material Asset

Since materials can be used on multiple game objects, it is an and it appears in the window and stored in the Assets folder.

Right-click in the Project window or click on Assets in the taskbar.

Select Create > Material.

This will create a new asset in the Project window in the current folder:

Name your material and press the Enter/Return key to confirm.

Note: Unlike scripts, renaming a material is safe and will update editor references to it.

Applying the Material

This can be done before or after updating the properties. Many developers add the material first to see how the game object will look as they mess with the material options.

To apply the material, simply click and drag the material onto the game object in the Scene window, Hierarchy window, or (if selected) into the Inspector.

Common Properties to Play With

These properties are listed in the order you'll find yourself using the most often.

Color

Click on the color picker to choose the color or input color values. Click on the link below for more details:

Textures

Textures are 2D images that get wrapped around objects with the material they are attached to.

To add a main texture, click on the circle/target icon to the left of "Albedo." A window will appear listing your available textures - those in your Asset folder and a few built-in options.

Double-click or select the asset and close the window. The texture will appear in the square next to Albedo.

Using a texture with a color other than white could affect the look of your material.

With the current texture and color, the preview of the texture at the bottom of the Inspector window looks like this:

What it looks like on a cube in the scene:

Emission

Materials appearing to glow use the Emission property.

Click the checkbox to see more options.

This property can glow based on a color or a texture. The Tiling and Offset are for tweaking textures. HDR colors have an intensity setting to contribute to it's "light source" appearance.

Example of a material named "Glow" with a black albedo color and bright green HDR emission color:

What it looks like on a cube in the scene:

Metallic

This property can make reflective materials.

Example of a material using a white albedo and maximum Metallic setting of 1:

What it looks like on a cube in the scene:

Example of a material using a white albedo and maximum Metallic and Smoothness settings of 1:

What it looks like on a cube in the scene:

Normal and Height Maps

Normal and height maps are a type of texture that looks similar to the main albedo texture that is colored in a way to convert the texture into having the appearance of detailed depth. These are used in more advanced texturing and material techniques that allow developers to create super detailed scenes with very basic shapes.

Occlusion

Occlusion tells the program what NOT to show. This property can be a texture to help add another layer of detail, similar to Normal and Height maps.

Tiling and Offset

Many textures are not "seamless" and will appear with a very noticeable seam down the middle of your game object. This Tiling and Offset property lets you stretch/zoom in or compress/zoom out the texture on the X and Y axes using the Tiling setting. To move the texture on either axis, use the Offset setting.

Example of using a tiling of 5 on both axes:

What it looks like on the cube object in the scene:

Similar to enlarging lower quality images, lower-quality textures will look kinda crappy when zooming in (tiling less than 1). If you plan to use parts of a texture, try to find images that are larger.

Rendering Mode

This mode is where you can make a material render in different ways, including transparent.

Shaders

As mentioned above, Shaders are powerful code that can tell the computer exactly how a surface or material should appear. In fact, "Standard," is the shader all these properties are part of. Standard is a good place to start, but some tutorials might tell you to choose another.

When the asset is selected, the will show its properties.

Inspector
Update Components in the Inspector
asset created
Project
Properties for a standard material called "Wood Material"
Wood is a texture I added to the Asset folder. The other textures are built-in to most projects.
Default settings
This is so metallic and smooth, it reflects the skybox to the point of looking transparent.