Fire at Will!

Read Time:1 Minute, 11 Second

I decided to handle damaging the target on the Particle System because OnParticleCollision is triggered on Particle Systems as well as the object hit by a particle. The script has to be on exactly the right part of the Particle System though, and in my case that was really deep into the heirarchy.

I decided to go with a system more like the one used in Argon Assault, which is that damage is handled by the target of an attack. This is the Collision Handler class that I added to the Enemy. The GameObject other is the part of the Particle System that has struck the enemy.

This script lives on the Enemy Prefab.

The Attack script below was formerly placed on a rather deep level in the Tower hierarchy since I am using a rather complicated Particle System. I kept the old OnParticleCollision method for reference. The Attack script now lives on the Tower object and we grab it using GetComponentInParent in the Collision Handler script. DamageDealt is now a getter property of the Attack script.

This script lives on the Tower Prefab.

Alright, in one of the videos between 146 and 149 we get challenged to do audio, which is what we’ve got going on in this video. I do apologize for the quality. I’m not sure why I’m not getting HD output anymore, but I’m not.

Machine Guns, oh My!

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleppy
Sleppy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

Your email address will not be published. Required fields are marked *