Post 12: Combo Attacks; Part 2
Today I elaborated on what I had done previously with the combos. As it stood, I had a character with a fairy janky 2-part combo that could equip his weapon to attack. My aim for this session was:
- Build on this to create a 3-part combo
- Have the player leap forward a little bit
- Have the camera shake
- Have the animations be smoother and more synergetic.
- Add a sword trail
- Adding blocking
This session was a good chance to get the basic attacking maneuvers down and would set me up to easily implement crouch attacks, jump attacks, air attacks, sneak attacks…. etc.
1. 3-Part Combo
This was a quick fix. I built off the original 2-part combo graph by expanding the “Select” function to 3, adding a final combo.
From there I increased the “Switch on Int” function so that it would allow for a 3rd variation. The first two options I implemented a ++ to “Attack Count” integer branching off, the the final total of the “Attack Count” being reduced to 3% and being rounded down (being an integer) – allowing the combo cycle to repeat.
Finally I set the delay between mouse push registering and hooked the third combo line into the loop.
2. Attack Leap
These are fairly simple, they basically utilised an impulse function and apply that to the location of the mesh.
To make sure it’s going to leap in the correct direction, I input the forward vector of the capsule collider as this rotates with the mouse.
3. Camera Shake
Camera shakes are really good for feedback and help to create the perception of power.
I started by creating a camera shake blueprint and established the intensity and rotational perimeters in there. From there I inserted a bunch of Camera Shake cues into the animations that would trigger the camera shake – same principles as the audio cues from my last post.
From there I put a call to function at the end of my player leap. Boom. Done.
4. Better Animations
This is on going. I went back to Mixamo, cut up a 3 phase attack sequence and replaced the existing animations. Not exactly what I’m after, but an improvement.
5. Adding Sword Trail
This was created using a particle effect, a blank skeleton and two sockets. The particle effect utilises a semi translucent white material and is stretched between the two sockets, fading over time.
This is then activated in the attack function created earlier and is de-activated after 0.6 of a second.
Simple, but more importantly customisable. I imagine replacing this with more subtle air displacement effects – but for now it will do.
I started this by downloading a blocking animation from Mixamo and creating an input to block, in this case the right mouse button.
From there, I created a function that branched off to either blocking or not blocking. On the blocking path, I put in a check for equip / equip if not and then a play anim montage function.
On release, I just put in a series of checks to ensure that the player is already blocking and then a stop anim montage function.