Beetle stands to attack

You will recall that the Cucumber Man has the ability to throw cherries at the Cucumber Beetles. This is a ranged attack, and if the Cucumber Beetle were to start walking or running on the ground toward the Cucumber Man to attack, it is likely the beetle would die before reaching the Cucumber Man.

So, if a beetle is hit by a cherry, we want the following to occur:

  • Beetle faces Cucumber Man
  • Beetle stands
  • Beetle runs, while standing, towards the Cucumber Man
  • Beetle attacks Cucumber Man while standing

You can review the animations if you need a refresher on what they look like. 

We will make some significant changes to our BeetleNPC script. The updated script is presented in the following code in its entirety, divided ...

Get Getting Started with Unity 2018 - Third Edition 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.