# Check if AI can't reach target

**URL:** <https://forums.unrealengine.com/t/check-if-ai-cant-reach-target/388874>\
**Category:** AI\
**Tags:** ai-navigation, path-follow, unreal-engine, UE4, Blueprint, question\
**Created:** [March 24, 2017, 1:33pm UTC](https://forums.unrealengine.com/t/check-if-ai-cant-reach-target/388874 "2017-03-24T13:33:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MadnessReloaded](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MadnessReloaded](https://forums.unrealengine.com/u/MadnessReloaded)\
**Post date:** [March 24, 2017, 1:33pm UTC](https://forums.unrealengine.com/t/check-if-ai-cant-reach-target/388874/1 "2017-03-24T13:33:52Z")

</div>

So, I’m creating an artificial intelligence character. He can detect, follow and attack me if, naturally, I’m in a navmesh.

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/5/b655c57a624d1eb5dd18f3690e45eaf793ca6879.png)

As you can see, there is a void between the player (grey) and the AI (orange).  
Now, I want the AI to stop trying to move toward me if the void separates us, so I check if he can’t reach me. I know I can use either AIMoveTo’s “On Fail” exec or HasPartialPath, but…

![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/9/1/191ec172bd73ce92389b44468d0540af301172ad.png)

“On Fail” only gets triggered if I’m not in a navmesh, so, it would only work if it was like this.

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/a/1/da12829631bd04c0d2c47cb2429d82e796fcd190.png)

If I’m in a navmesh, no matter if the AI can’t actually reach the destination, it will say the path will succeed.  
What I want the AI to do is, no matter if I’m in a navmesh or not, check if it can’t reach the destination.  
How should I do this?

---

<div class="post-metadata">

**Author:** ![Knight9871](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Knight9871](https://forums.unrealengine.com/u/Knight9871)\
**Post date:** [March 24, 2017, 2:24pm UTC](https://forums.unrealengine.com/t/check-if-ai-cant-reach-target/388874/2 "2017-03-24T14:24:13Z")

</div>

Sorry dude I don’t know how to help o may some day but tell then look for a tutorial!

---

<div class="post-metadata">

**Author:** ![JayWebb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JayWebb](https://forums.unrealengine.com/u/JayWebb)\
**Post date:** [March 25, 2017, 11:55am UTC](https://forums.unrealengine.com/t/check-if-ai-cant-reach-target/388874/3 "2017-03-25T11:55:45Z")

</div>

You may be able to see if the AI can move by using the EPathFollowingResult  
It should tell you if the path is blocked, off path, invalid etc.

 ![131593-aimoveto.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/6/26609d1d892d4515675fed5bceca6c5435b91582.jpeg)

---

<div class="post-metadata">

**Author:** ![MadnessReloaded](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MadnessReloaded](https://forums.unrealengine.com/u/MadnessReloaded)\
**Post date:** [March 26, 2017, 9:46am UTC](https://forums.unrealengine.com/t/check-if-ai-cant-reach-target/388874/4 "2017-03-26T09:46:35Z")

</div>

Wow, thank you so much!

---

<div class="post-metadata">

**Author:** ![Yoshift](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Yoshift](https://forums.unrealengine.com/u/Yoshift)\
**Post date:** [August 1, 2024, 1:49am UTC](https://forums.unrealengine.com/t/check-if-ai-cant-reach-target/388874/5 "2024-08-01T01:49:16Z")

</div>

Hey, It seems that my AI when blocked can succed all the time  
do you have a solution?
