Blueprints/fight system,

Ive been trying to build a simplified 4 punch fight system, for an npc for later use in vr, for a playful sparring game, but i am tripping up and am pretty frustrated right now, im only trying to build a simple, hit/reaction system, i have the ABP, the BP_fight system all the IA’s for each input action, now im trying to set the system up so i can create the game around it but im struggling probably more then i should be at the point. Can anyone help?

can you please give more details, on:

  • what do you mean by “4 punch fight system”
    • a string of up to 4 attacks in a chain before a cooldown?
    • there are 4 different punches the player or entity can choose between?
    • there are 4 buttons that each punch…?
  • what is not working (how do you expect it to work, what is it doing that isn’t the expectation)
  • what have you tried?

are you trying to work on all of them at the same time, get one specific case working, and then duplicate, or abstract it to a more broad implementation (we can’t abstract cleanly unless we have a valid working case).

at the very core all we need is:

  • InputAction_Event
  • a check that we are not already playing the animation we wanted to play (this will be bookkeeping on your part for how you want to track it)
  • PlayAnimMontage() (search for “Montage”)
    • we use Montages for better integration with RootMotion, and to not break Animation Blueprint.
    • there is a PlayAnimationMontage() and PlayMontage() depending on whether we are working with an ACharacter, or an APawn. the one for ACharacter has additional callbacks, and because of inheritance the one for APawn can still be used with ACharacter.

where we are talking about potentially a string of attacks then you will need to implement some kind of InputQueue; this is not “common enough” (even though in 99% of cases if your game has animation based stuff then you should probably have an inputQueue of some kind) or easily generalizable for it to be built into the engine, so you are responsible for it. the closest the engine gets is the GameplayAbilitySystem, but every time I see that as an answer for input queueing it feels like a bazooka to deal 1 hp of damage.