Book Image

Unity 5.x Game Development Blueprints

By : John P. Doran
Book Image

Unity 5.x Game Development Blueprints

By: John P. Doran

Overview of this book

<p>This book will help you to create exciting and interactive games from scratch with the Unity game development platform. We will build 7-8 action-packed games of different difficulty levels, and we’ll show you how to leverage the intuitive workflow tools and state of the art Unity rendering engine to build and deploy mobile desktop as well as console games.</p> <p>Through this book, you’ll develop a complete skillset with the Unity toolset. Using the powerful C# language, we’ll create game-specific characters and game environments. Each project will focus on key Unity features as well as game strategy development. This book is the ideal guide to help your transition from an application developer to a full-fledged Unity game developer</p>
Table of Contents (19 chapters)
Unity 5.x Game Development Blueprints
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

Working with sorting layers


Next, I want to ensure that the sprites that we added will actually be in the correct order from any of the other sprites that we add to the level. This is because when we place objects on the same Z position, we are telling the graphics card that we don't care what order the images are drawn to the screen (also known as z-fighting). In this case we do and even if it "looks right" in the editor right now, if you ever load or restart the scene it may not look correct so rather than wait for the problem I suggest we fix it now. I could change the Z position of the object, but rather that, we can make use of the sorting layers property instead:

  1. Select one of the background objects from the Hierarchy tab and then from the Inspector tab, go to the Sprite Renderer component and click on the Sorting Layer dropdown. Then, select Add Sorting Layer… click on the + icon two times and name the newly created layers Background and Foreground. From there, bring the Background...