Part 20 - Walls.
There will be a minor problem that may be obvious with the current game though?
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
I moved them into position like so
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…
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
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.
- Part 01 - Installation
- Part 02 - Concepts
- Part 03 - Navigation
- Part 04 - Git and Unity
- Part 05 - Building a project
- Part 06 - Adding some plugins
- Part 07 - Creating some objects
- Part 08 - Physics
- Part 09 - Pushing things & animation
- Part 10 - Pushing coins
- Part 11 - Custom Scripting
- Part 12 - Spawning things
- Part 13 - It is still too fast
- Part 14 - Coins are piling up
- Part 15 - Materials
- Part 16 - User control
- Part 17 - Keyboard input - Fire
- Part 18 - Keyboard input - Movement
- Part 22 - Adding the GameController
- Part 23 - Scoring links with events
- Part 24 - Refining the Game - Part 1
- Part 25 - Refining the Game - Part 2
- Part 26 - Refining the Game - Part 3
- Part 27 - More refinements
- Part 28 - Slowing the user down
- Part 29 - Some more changes