Reworking the melee combat to launch yourself forward on attacks to get more movement.

Howdy,

Okay so the issue with the melee system as-is is that there's no forced forward movement on a swing, that's really not gonna fly so i need to make it so that each attack (ideally controllable on a per-animation/move basis) will fling the character forward a bit on the forward z. (so say, when you are in the demo and unarmed and you do a punch, your character moves 2 units forward on their local z axis while playing the animation, no rootmotion stuff) So that each attack can get you momentum and not force you to rely 100% on rootanims. This is pretty common for melee systems.

How would i go about implementing this? I COULD make a custom version/rewrite the Melee Weapon script I suppose, and add in some sections dedicated to forward momentum. I guess i could write an addon script that reads inputs or something? would this be a new item ability or character ability? Or perhaps there's somehting built-in that'd do this for me and i missed it.

i mean i guess the answer is "yeah all that would work" and ineed to just pick one but given that this would be a Pretty Fundamental change to how the whole melee system kinda works, i figure i'd ask for best practices here. Thank you!


//
i guess on a similar note, a Halo styled sword lunge is also something i wana build. (If you've got a valid target and using a melee weapon, when you attack launch youself forward with a force of like 5 or something then slowdown). which i mean feels super clear as an ability or something, but would that double-up the input on the melee attack component, or would that need to be written in if i want it to be fundemtnal?

again this is all stuff i think i know how i'd do in isolation but am doubting when it comes to how UCC ties itself togehter.
 
Last edited:
A lot of that would be animation related with root motion. Beyond that you could subclass the MeleeWeapon and apply a force when the StartItemUse method is called.

Edit: For more intense effects having a specialized ability similar to the In Air Melee Use ability would also work. Subclassing MeleeWeapon is easy for a single force though.
 
Last edited:
Yeah, that makes sense. I gotta get my head around subclassing things more often. Alrighty i'll go ahead and give that a try and report back how it goes. Thank you very much!
 
Top