How to create a material in Unity

All Gameobjects with a renderer in Unity use materials. The material property defines the look and feel of the gameobjects. A material consists of Textures and Shaders that help Unity to compute the Lighting parameters for the object. We will cover Shaders and Textures in a different tutorial.

In this tutorial, we will see how to create a basic material and apply it to your game object. We will be using a physics material, a glass material and a glowing material for this purpose. I will be using Unity 2021.3 for this tutorial.

Creating a new material

Glass material( Transparent)

  1. Go to project window.
  2. Click on the + sign.
  3. Select Material and rename the new material as Glass material.
  4. Go to Inspector and select Rendering Mode as Transparent.
  5. Set the alpha value in Albedo to zero.
  6. Adjust Metallic and Smoothness values.( Keep Metallic minimum to obtain transparency).
Glass material properties

Physics Material

  1. Go to project window.
  2. Click on the + sign.
  3. Select Physic Material and rename the new material as Physics material.
  4. Go to Inspector Window and enter values for Friction and Bounciness.
Physics Material properties.

Glowing Material

  1. Go to project window.
  2. Click on the + sign.
  3. Select Material and rename the new material as Glowing material.
  4. Go to Inspector window and check the Emission box.
  5. Select the color of light and intensity.
  6. Select the way the emission will affect the environment using the Global Illumination setting.

Adding material to your Gameobject

There are two different ways to add the material to your game object.

First method

  1. Select the gameobject in the Hierarchy or Project window.
  2. Go to Meshrenderer ( renderer may differ based on the type of Gameobject).
  3. Select the material in the Materials tab.

Second Method

This is the most easy way to apply a material. Drag and drop the material on to your gameobject in the Hierarchy view.

TIp: Gameobject should have a renderer to apply the material.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.