Announcement

Collapse
No announcement yet.

Handling AI Death in Blueprint

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    i have the same issue, Can you share more info on how you got this done? I ma new to UE4 and creating Games. So far i have this in BP but player follows me after the montage is done

    Leave a comment:


  • replied
    Figured it out. I changed some stuff up (added a search for player behavior, and a wander behavior). Then I also added a death check, and if it fails that, it goes into the death behavior.
    Click image for larger version

Name:	BehaviorTreeDeath.png
Views:	1
Size:	266.0 KB
ID:	1072066

    Leave a comment:


  • replied
    I set that up and it works fine. I just it in the controller. However, the BT keeps going, so while the death animation montage is playing, the AI is still following me around the level. Is there a way to stop the BT before I play the montage?

    Leave a comment:


  • replied
    I would do the death in the BP itself. Much easier.

    If "Health" =< 0 then "Play Anim Montage" Then "Delay" to allow montage to finish, then "Destroy Actor"

    Narg

    Leave a comment:


  • started a topic Handling AI Death in Blueprint

    Handling AI Death in Blueprint

    It's probably partially my newness to BTs from FSMs, but I'm having trouble setting up dying and dead "states" to my AI's behavior tree. When the AI's health reaches 0, I want to play a dying animation. After the animation's played, I want the enemy to fade out and delete himself (and the AI controller, weapon, pawn etc..). I could hack this together in the AI controller, but I'm really giving behavior trees a chance. My gut tells me that I should be using behavior trees for this. I appreciate any tips, or examples. I currently set a Blackboard Key 'Dead = True' in the AI controller when health <= 0, then "listen" for that Dead key in the BT.

    Here's my behavior tree currently, I'm sure I'm doing it wrong. All of it works fine except for the Dying part.
    Click image for larger version

Name:	BehaviorTreeForDyingAI.png
Views:	1
Size:	159.9 KB
ID:	1146212
    Last edited by CharlieTheTall; 03-16-2015, 01:26 PM.
Working...
X