How To Apply Color To A Game Object In Unity?
Learn how to add colors to your Game Object in Unity and build your own library of colors for Games, Applications, and AR/VR Experiences.
What are you going to learn?
Most of the time when you are using Game Objects in Unity, you would like to add some color to them so that all your Game Objects look different from each other.
In this article, I will show you a simple method to apply any color to a Cube.
This same technique can be used to-
👉 apply color to all your Game Objects
👉 build your own library of colors for your game, application, or AR/VR experience
P.S — To make it easier to understand, I will treat “material” and “color” as the same thing for the rest of this article and use it interchangeably. Just remember though, that they are not the same.
Let’s begin with a blank sample scene.
Step 1: Create a folder that contains all the colors
It’s always a good practice, to begin with creating a folder that contains all your colors or materials. This helps in creating a palette(or a collection of colors or materials) and makes it easier for you to apply the colors (or materials) in your palette to the Game Objects.
Step 2: Create a material
The next step is to create a color(or material).
Step 3: Change the albedo property of the Material
Then select the created material and check out its properties in the Inspector Panel on the right-hand side.
Great! Now you can create a collection of colors using the same technique.
Now we can apply the color to any Game Object.
I am going to use a cube for the demo but feel free to choose any other Game Object.
Step 4: Add a cube to the Scene
Step 5: Drag and drop the material into the cube
Then simply drag and drop the material that you created above onto the game object like this👇
That’s it!
You can now create a set of colors for 3D applications, games, or AR/VR experiences that you develop in Unity.
There are many more things that you can do with Materials in Unity to make your Game Objects look stunning! This article is just the beginning. I will brainstorm on some more articles about Materials and what you can do to make your Game Objects stand out in Unity.😉
Enjoy👏