Unity is all about simulating real-life situations. Real-life materials like glass, metal, etc are also available for use. If you want the player to see itself, you can create a mirror wall. You can even create a disco ball. So sky is the limit.
In this Tech-Recipe we will tell you How to Make a Glass Wall in Unity. Since in our previous articles, we have been creating a roll a ball game. We can continue with that too. Let’s say you want the walls to be made up of glass material.
What you have to do now is to make all four walls first. You can do that using a cube and reshaping it to look like a wall. Once you have the wall perfectly placed on all three sides of the plane, you can create the material. To create the material, you have to create a material in the project folder. It is preferable to have a folder named materials.
Now you can create a new material and make some simple changes to make the material look like glass. Finally you can apply the material on all four of your walls.
Will the walls shatter?
No, unfortunately not. By just applying the glass material it will not obtain the physical properties of shattering. It will only have the appearance of a glass. Shattering of the glass is a topic of another tech-recipe. For now just check out the complete steps of making glass walls.
How to Make a Glass Wall in Unity
1. Go to “GameObject”
2. Add cube.
3. Resize the cube to look like a wall.
4. Place the wall right on the edges of the plane.
5. Duplicate the wall to place to the other edge.
6. Reposition the wall,set y-axis rotation to 90 degrees to set the wall to other sides and duplicate again to cover the last wall.
7. Hit the material folder and Click on “Create”.
8. Click on “materials”
8. Set rendering mode to the transparent, alpha channel to zero, and smoothness to middle
9. Apply to the walls.