I am trying to setup a melee combat system for touch devices.
The mechanic I am looking forward to achieve is similar to ‘couch knights’.
I want to swipe, make an action happen and then revert to original state.
So to do this i setup a state machine for root and then branching state machines for Attack, Defense, Getting hit and others.
I tried using Anim Notifies but i found out that since i am sharing animations amongst both players, the notify took place for both the players.
So i adopted another method and tried to use the EndTransitionEvents to make changes to variables.
For eg, when bHitting is true, i am changing to ATTACK StateMachine, and based on enum AttackType, i am calling the specific animation.
Then on TimeRemainingRatio to asset, via BeginTransitionEvent i change** bHitting to False** and change enum to NONE.
I’ve also created an enum for PlayerState & AI State, which keeps track of states, such as, isIdle, isAttacking, so on and so forth.
This setup seems good in theory, so i began testing it.
I saw that when testing on desktop after a while into the game, the BeginTransition events did’t fire up.
Following which the player is stuck in that state and keeps looping a specific animation.
Worse still, when testing on iPad 3, after just a few seconds into gameplay, the Transition Events didn’t fire.
I’ve double checked my setup using print statements and have spent nearly a day on it.
Can someone suggest me a more robust manner of achieving this? Like how to Tap, change a variable, Move the player, Play Animation, and then change the variable back again.
I am wondering if i should discard AnimBP and calling Anims from the Character Event Graph.
Could it be that AnimBP’s take a toll on processing??
I don’t wanna discard AnimBP’s that since it’ll beat the purpose about using BlendSpaces and other stuff.
Should i switch to C++ to carry out this for mobile??
Please suggest, any help would be great?