Hey everyone, im having a small problem with creating an attack animation for an enemy AI. All the animations are working correctly but whenever i get within range of the enemy it just keeps repeating the attack animation and the animation only plays when i go out of the enemy view.
Hello, and I’m going to hold you to task here, so please don’t take it personally:
These are conflicting statements. And you haven’t provided a video to clarify your issue. (You can add a link to a video if you cannot post one.)
Be aware that programming is logic… order… and if you are unclear in organizing your ideas to specify a coherent question, it probably means you’re unclear in organizing your ideas to execute logic.
Apologies if I’m being rude.
Anyway, please post a video, because I truly do not understand what you mean. It’s possible that I’m not understanding your meanings of “range” and “view”. Are they independent?
dont worry about being rude i understand that I could have worded it a lot better than what I did. But heres a link for something more visual. To clarify more i meant the AI only keeps repeating the start of the attack animation like the first couple of frames and I am only using the sight of pawnsensing inside of the AI blueprint.
Thank you for clearing this up!
I haven’t used the SENSING systems because I create my own, however, my question is what is the repeating trigger of your code?
I ask because I’m not sure if the SENSING system is looping/pulsing or a one-off.
To check for this, add a PRINT STRING between FOLLOW PLAYER and “Can_Attack?”.
If you see:
Hello
Hello
Hello
Hello
Then that is why your animation keeps getting interrupted and you’ll have to redo your logic.
thanks, ive given it a test and yes it keeps repeating, can you explain what you mean by ill have to redo my logic? would i have to just have to write the attack segment again or find a new way to do it?
Okay, the problem you’re having with this system is that it doesn’t have a negative function associated with it. You attempt to reset the variables WITHIN the function, but for the function to run, “Is_Seeing_Player?” needs to be set to true.
I’m guessing your SENSING INTERVAL VALUE is lower than the value for the animation itself. You need to make the value longer than the animation. This is only a quick-fix however:
Truthfully, to have a stable code, you’d need to redo the whole thing. But if you’re only trying to get the effect, this should work.