Skip to Main Content
Unity 2018 By Example - Second Edition
book

Unity 2018 By Example - Second Edition

by Alan Thorn
July 2018
Beginner content levelBeginner
484 pages
9h 36m
English
Packt Publishing
Content preview from Unity 2018 By Example - Second Edition

Enemies

The next step is to create something for the player to shoot and destroy, which can also destroy us, namely, enemy characters. These take the form of roaming spaceships that will be spawned into the scene at regular intervals and will follow the player, drawing nearer and nearer. Essentially, each enemy represents a complex or combination of multiple behaviors working together and these should be implemented as separate scripts. Let's consider them in turn:

  • Health: Each enemy supports health functionality. They begin the scene with a specified amount of health and will be destroyed when that health falls below 0. We already have a Health script created to handle this behavior.
  • Movement: Each enemy will constantly be in motion, traveling ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unity 2020 By Example - Third Edition

Unity 2020 By Example - Third Edition

Robert Wells
Unity 2018 Cookbook - Third Edition

Unity 2018 Cookbook - Third Edition

Matt Smith, Chico Queiroz, Jate Wittayabundit

Publisher Resources

ISBN: 9781788398701Supplemental Content