Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning C# by Developing Games with Unity 2019

You're reading from   Learning C# by Developing Games with Unity 2019 Code in C# and build 3D games with Unity

Arrow left icon
Product type Paperback
Published in Mar 2019
Publisher Packt
ISBN-13 9781789532050
Length 342 pages
Edition 4th Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Harrison Ferrone Harrison Ferrone
Author Profile Icon Harrison Ferrone
Harrison Ferrone
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Section 1: Programming Foundations and C# FREE CHAPTER
2. Getting to Know your Environment 3. The Building Blocks of Programming 4. Diving into Variables,Types, and Methods 5. Control Flow and Collection Types 6. Working with Classes, Structs, and OOP 7. Section 2: Scripting Game Mechanics in Unity
8. Getting Your Hands Dirty with Unity 9. Movement, Camera Controls, and Collisions 10. Scripting Game Mechanics 11. Basic AI and Enemy Behavior 12. Section 3: Leveling Up Your C# Code
13. Revisiting Types, Methods, and Classes 14. Exploring Generics, Delegates, and Beyond 15. The Journey Continues 16. Completed Game Files 17. Supplementary Classes 18. Pop Quiz Answers 19. Other Books You May Enjoy
Movement, Camera Controls, and Collisions

One of the first things players do when starting a new game is familiarize themselves with character movement and camera controls. Not only is this exciting, but it also lets your players know what kind of gameplay they can expect. Hero Born's character will be a capsule primitive that can be moved and rotated using the W,A, S, D, or arrow keys.

We'll start by learning how to manipulate an object's Transform component and then replicate the same control scheme using applied force, which produces a more realistic movement effect. When we move the player, the camera will follow along from a position slightly behind and above, making aiming easier when we implement the shooting mechanic. Finally, we'll explore how collisions and physical interactions are handled by Unity's physics system by working with our item pickup prefab.

The following topics...

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 R$50/month. Cancel anytime