© Casey Hardman  2020
C. HardmanGame Programming with Unity and C#https://doi.org/10.1007/978-1-4842-5656-5_24

24. Spike Traps

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

The final obstacle we’ll implement will be a spike trap. It will teach you a new concept and give you more practice with the concepts we learned in previous chapters, like Lerping over time, working with state, and Invoking methods to time transitions in the state.

Our spike trap will be a thin, square “plate” laid out on the floor which has lots of little “spikes” sticking out of it. For simplicity’s sake, we’ll make the whole thing out of cubes. When the trap activates, the spikes quickly raise, poking up out of the plate. They’ll remain raised for a moment and then slowly lower ...

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.