© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
C. HardmanGame Programming with Unity and C#https://doi.org/10.1007/978-1-4842-9720-9_18

18. Patrolling Hazards

Casey Hardman1  
(1)
West Palm Beach, FL, USA
 

Now that the game is shaping up more, it’s in need of some greater obstacle variety. In this chapter, we’ll implement “Patrollers,” and along the way, we’ll get hands-on experience with a heap of important, powerful concepts.

Patrollers are objects that we set up with a series of points they’ll travel along. They move from one point to the next, starting at the first point and going down the list. Once they reach the last point, they double back to the first point again and then repeat the process. We can ...

Get Game Programming with Unity and C#: A Complete Beginner’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.