top of page

Day 40: Weapon Combos

My plan for the day: Now that I had something to attack that could be defeated, it was time to make the player's combat slightly more immersive by adding different variations of weapon patterns, aka combos.


What I accomplished:

Creating these weapon combos was not as easy as I initally anticipated. What my plan was originally was for me to add in such a wide variety of attacks that the player could create an infinite number of combos by themselves as they experimented. However, there would be quiet a few issues with this. First and foremost, how tiresome it would be for me as a game developer to find, rig and then chain the attacks fluently together. Second, it would lag out the game uneccessarily, because of the number of animators I would have to set up. Instead, I would rely on the player pressing the "E" or "R" key several times, which would then play different animations. This way, I wouldn't have to add in as many animations, and while it would certainly be less entertaining than the first option, it was much more practical. So I started off by coding in the player attack script, creating a public void for handling the combos, which stated that if the last attack was a light attack in the right hand, the next attack would be programmed to play a heavy attack with the left hand, given the heavy attack button was pressed. Once that was done, I added in a few flags for enabling and disabling the combo. Much like how the damage collider was triggered for a certain amount of frames, the enable combo would only be enabled at the end of of an attack for a certain amount of frames, in which in the player has to press a specific key for the combo to start. Doing this much allowed us to combo, but a certain problem that arose was hitting the attack key over and over again would cause the animation to not complete the first one, and always start the second one before the first attack even finished. To correct this, I added in two lines of code stating that if the player manager was called in the combo instance, it had to return a value before moving on. This meant that it could not start another attack before the first one finished.


______________________________________________________________________________________________________


Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page