AI beginner help

Hello, I am asking for help with an AI problem.
I’m a beginner and after looking for several solutions I haven’t found anything concrete.
Concretely I have my AI which as soon as it sees a player rushes at them and applies 100 damage.
When my player suffers 100 points of damage he is down and obtains 100 more life points before final death.
The AI ​​rushes on the player and one shot my player, I think it’s because the AI ​​play jumpscare on the player he stays in contact and applies 100 damage continuously maybe ? I would like the AI ​​to down the player and leave him alone to possibly chase away other players who are not down and for the downed player to be able to be revived. How can I resolve this? thank you very much in advance


(AI BP)



(BP Player damage and downed system from Matt Aspland https://www.youtube.com/watch?v=iGxUcpqjUVc&t=1082s)

Thank a lot

Hey @camerone95!

I think you’re right, it’s triggering multiple times.

Instead of the “On Component Begin Overlap” You could put the Apply Damage node on the success of the moveTo node instead, and pass in the player it is targeting as the Damaged Actor. Then you know it will ONLY apply damage IF that MoveTo node succeeds?

I’m not sure what “Kill Player” does so I’m not sure if this is helpful or not, based on not knowing what that event does. It looks like you have multiple ways that the enemy can kill the player.

Give that a shot and let us know how it goes!

Hello
The kill player is a death animation with the logic of facing the AI ​​regardless of the player’s direction.
I tried your solution and it works quite well.
The AI ​​however returns towards the down players if there is no other player around to kill them, how can I tell the AI ​​not to attack a down player only the no down players ? because the down players dies from them even if no one helps them.
my second problem is this error message Blueprint Runtime Error: “Accessed None trying to read property LastHitBy”. Node: Set Control Rotation Graph: EventGraph Function: Execute Ubergraph BP IA Blueprint: BP_IA
Visible on the screen
the problem is that I don’t understand where the problem is lol


Hey @camerone95!

Try this:

The goal here is to check if the observed player is down, if they are down, do not do the AI MoveTo, and if they are not, do not register them.

The problem is, if it does not sense another player, it has no one to chase and therefore will re-select the player when they get up.

Maybe give the player the ability to lay still until it is drawn away?

Thank you for the screen I understand better the way to do it, I did not specify the fact that IsDowned? It comes from the Animation blueprint of my Player so it gives that.
I can’t connect to the pawnsensing pawn, what would be the solution?

Okay, no worries, easy fix!

So you need to have an “IsDowned?” Bool on your PLAYER BP, not your anim graph (have it there as well, but instead of changing it on the Anim_BP, change it on your player when needed, and on the AnimBP’s Update get your player and get its Downed bool and set the anim_BP one based on that).

It’s not casting correctly because you’re trying to make a pawn behave as an anim_bp, which it is not. So you need to take that out, cast to your player, have the is down bool on your player, and pull from that. :slight_smile:

thank you very much
the system works perfectly thank you for giving me your time :+1: :+1:

1 Like