Part 20 - Walls.

By Jamie Chatterton / 2018-06-12

There will be a minor problem that may be obvious with the current game though?

Open this image in a new tabCoins fall off the side
Coins fall off the side

Coins can fall off the side.

Shall we add some edges to the machine so it doesn't happen? Using the floor object as a base?

I created a "left-side" and a "right-side" object. With the grid spacing set to 0.5

Open this image in a new tabGrid spacing 0.5
Grid spacing 0.5

I moved them into position like so

Open this image in a new tabEdges in position
Edges in position

However, they are a little too in the way now. So I'm going to create a material that is mostly transparent. A kind of plastic/glass like material.

The material I created was called 'glass' with the following settings…

Open this image in a new tabGlass settings
Glass settings

Basically setting the "Rendering mode" to "Transparent" and adjusting the "Albedo" colour so the "A" (Alpha) colour is fairly low, to give it the transparency.

Applying this to the walls, through ProBuilder, is enough (Material Editor), there may be the odd bug where you have to directly drag the material onto the object in the Hierarchy or the Scene view. ProBuilder sometimes is still trying to apply multiple materials and not working correctly.

You can play with the colour and smoothness options to change how it looks. There also things you can add like a normal map, height map, detail mask, to give it a rough surface, make it look a little worn, a little more realistic, if so desired, but the main goal here is to just not have it obstruct the view.

This leaves me with

Open this image in a new tabThe final product
The final product

I also pulled the front of the walls over the darker 'collection' point, so the coins don't spill there either.

Git respository: https://bitbucket.org/hiveit/unity-tutorial-coin/src/016_AddingWalls/

More posts in this series.