Working with materials
Previously, we have always used the default material for everything in our project. This has worked out well for us, but it may be a good idea for us to talk a little bit about creating custom ones to improve the visuals of our player. Materials are instructions on how to draw 3D objects within Unity. They consist of a shader and properties that the shader uses. A shader is a script that instructs the material on how to draw things on the object.
Shaders are a huge subject that entire books have been written on, so we can’t dive too much into them here, but we can talk about working with one that is included in Unity, the Standard Shader. Implement the following steps:
- First, open the Gameplay scene. Then, let’s create a new folder in the Project window called
Materials
:
Figure 12.7: Adding Materials
- Open up the
Materials
folder we just created, and then once inside, create a new material by right...