# Behavior Tree / AI Run Away After Health \<50

**URL:** <https://forums.unrealengine.com/t/behavior-tree-ai-run-away-after-health-50/715955>\
**Category:** Blueprint\
**Tags:** Behavior-Tree, ai-controller, unreal-engine, enemy, Blueprint\
**Created:** [November 26, 2022, 9:45pm UTC](https://forums.unrealengine.com/t/behavior-tree-ai-run-away-after-health-50/715955 "2022-11-26T21:45:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![koriaginn](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/koriaginn/32/88719_2.png) [@koriaginn](https://forums.unrealengine.com/u/koriaginn)\
**Post date:** [November 26, 2022, 9:45pm UTC](https://forums.unrealengine.com/t/behavior-tree-ai-run-away-after-health-50/715955/1 "2022-11-26T21:45:39Z")

</div>

Hello!

I’m trying to make an enemy AI behavior tree following YouTube tutorials, but something ain’t right: I can’t set up proper conditions for the enemy to start running away if he’s getting damaged too much. I think there’s something wrong with my initial behavior tree because it’s working a bit glitchy (yet working).

Here’s how it looks now:

 ![screenshot-001](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/1/2/c12f41160523ff24fbca11d6461476b917d0d9b5.jpeg)

Could you give me an advice, how could I rearrange these blocks from two smaller sets into one bigger one without breaking it, so I could place the third smaller set to play next when the condition is right?..

Here is this part (of what I want to achieve at this stage) closer:

 ![screenshot-002](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/8/f/c8fec7760c6048e69136932298a8c79adf98c3ea.png)

The logic is: enemy notices’ player, runs to melee fight, runs a bit away if got hit, start shooting at player (all of this is working) and runs away if his health float is below 50% (that’s the point of the question).

Some more details →

RunAwayFromPlayer task:

 ![screenshot-003](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/a/9/ba9f353601d4d45fe51c78f3256f52433a06a61b.png)

Part of the enemy character blueprint with health check & blackboard bool set:

 ![screenshot-004](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/c/1/fc194ca53bb0d220a438053531526d551eaf99e3.png)

Please, tell me how can I improve my current visual code to achieve it? What am I missing?
