Let's Learn Unity

Опубликовано: 10 Июнь 2026
на канале: NC Learn wit Me
8
0

Hello guys, so today we go over lectures: 293 and 294

(Lecture 293) Make our Attackers Attack:
Similar to making Shooter objects attack. We setup a bool parameter in our transition called "isAttacking" which gets updated in our Attacker script. A specialized script is made for the Lizard object to detect for triggered collisions, if so then it calls an Attack() from the Attacker script which updates the bool isAttacking to true.

(Lecture 294) Attackers Striking Target
After implementing the attack animation for our attackers, in this lecture we make it so that it deals damage to the defender. We first create a method that would be called during a specific key frame of the Lizard's attacking animation. We also had to make sure that the defenders had a Health script on it. Next we needed to figure out how to transition the Lizard animation back to walking after the defender had been destroyed. The most optimal place right now would be to check if the Attacker has a currentTarget in the update(). If it doesn't have a currentTarget, then it will go back to its walking state