Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Building an FPS Game with Unity

You're reading from  Building an FPS Game with Unity

Product type Book
Published in Oct 2015
Publisher
ISBN-13 9781782174806
Pages 326 pages
Edition 1st Edition
Languages

Table of Contents (18) Chapters

Building an FPS Game with Unity
Credits
Foreword
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started on an FPS 2. Building Custom Weapons 3. Prototyping Levels with Prototype 4. Creating Exterior Environments 5. Building Encounters 6. Breathing Life into Levels 7. Adding Polish with ProBuilder 8. Creating a Custom GUI 9. Finalizing Our Project Index

Adding trees


Hills typically aren't just grass. Vegetation can be used to block a player's visibility and give a better look to our environment. Perform the following steps to add tress:

  1. From the Project tab, go to the Assets/Terrain Assets/Trees Ambient-Occlusion folder and drag and drop a tree into the world (I'm using ScotsPineTree).

    By default, these trees do not contain collision information, so our player could just walk through it. This is actually great for the areas that the player will not reach, as we can add more trees without having to do meaningless calculations. But we need to stop the player from walking through them, so we're going to add a collider.

  2. To do so, select the tree, select Component | Physics | Capsule Collider, and then change the Radius value to 1.

    Note

    You have to use a Capsule Collider for collision to carry over to the Terrain.

  3. After this, move our newly created tree into the Assets\MyGame\Prefabs folder under the Project tab and change its name to CollidingTree...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}