Piecing Together The AOE Attack

 Greetings!


This week I'd like to talk about how I managed to stitch together the player's AOE attack.  I knew that I wanted something that was castable and would show in the world where it would hit.  With these two things in mind, I immediately thought of how I had already created something that required a button to be held down (the heavy attack) and also something that created a "preview" in the world (the building system).  I quickly got to work to see how I could combine the two systems.









I wasn't able to re-use any of the buildable code, however I was able to re-use my weapon code in order to cast the spell.  As a child of the class that spawns the magic projectiles, I put this new AOE weapon in the player's other hand.  I only had to override a few functions by making them virtual in order to alter the code enough to do what I wanted.  As for the "projectile" that this new weapon was spawning, that is where I implemented the building code I had wrote earlier.  




The spell uses the exact same method as the buildings to detect if something is within its collider.  By keeping a list that is updated whenever something enters or leaves.  Once the spell has been active for the required casting duration, It was as simple as just doing damage to everything inside and then getting destroyed.  I even had some fun putting in some Niagara particle effects!




There you have it!  By piecing together code I had already written, I was able to effectively create a completely new system.  

Thanks for tuning in again this week and hope to see you again next time,

Corbin Mein

Comments

Popular posts from this blog

The Wonder Of Navigation Meshes

Issues With Interacting, A Tale Of Meshes