Hello, sorry if this is an easy question, but I am new to the server. I am making a sort of zombie game with AI enemies. I have managed that the AI senses me and runs towards me. But now I am having trouble with the animation and damage. I want the AI to do an animation when he’s standing next to me and do damage at the same time. This is my blueprint so far:
Thanks a lot already
First is there any particular reason why you are looping back from Setting health to Cast to Character?
Second do you want the zombie to deal damage to the player at a certain point within an animation?
Because i want him to run after me again when the damage is done or isn’t this loop necessary? I’d prefer that the damage is done when the animation is over
I’m sure for what you are doing it wont be a huge deal, correct me if i’m wrong someone, unreal runs separate event calls on their own threads. stuff like that can be dangerous and cause infinite loops. Though OnSeenPawn gets called every Sensing Interval that a pawn is within it’s sight range. If you click on the PawnSensing component and look under AI there is a Sensing Interval thats how often it checks for see / hearing something. if you want it to happen more often then make that number smaller, just don’t do 0 because it will stop updating. This way you wont have to do that dangerous loop back.
Second it normally makes more sense to people to take damage when they see the animation actually impact the player rather than before or after, but if you want it to do it when the animation finishes then we can get that working no problem.
O yea, so wait you are storing the players health on the zombie actor?
Thanks for your answer. Can you explain to what “the hack way” is? Yes it is a zombie. I have two kinds of health; currenthelath, which is from my firstperson character and aihealth which is for the zombie.
Thanks you! Oh so I didn’t have to create that looping? Yeah it is fine to do the damage after the animation ends. If you could help me with that, that would be awesome.
It is able to change that variable, but since you are not pulling a pin off from the character and then getting health, it looks like you are using the zombies health.
Oh I see. Thanks you. It would be great if you could go into more detail. It doesn’t have to be a difficult animation blueprint. Just run to the first peron character (which I have managed), then we he got to me attack (I have an animation for this) until I move again and then al over again. And then after he attacked me, that my health goes down. I have my players health set as a public variable. Or isn’t it able to change this variable in the event graph of the Ai character? Much thanks in advance!!