# The ia does not leave eyes the Player ue4 C++

**URL:** <https://forums.unrealengine.com/t/the-ia-does-not-leave-eyes-the-player-ue4-c/490127>\
**Category:** C++\
**Tags:** Behavior-Tree, behavior-tree-task, unreal-engine, CPP, question\
**Created:** [October 22, 2021, 3:23pm UTC](https://forums.unrealengine.com/t/the-ia-does-not-leave-eyes-the-player-ue4-c/490127 "2021-10-22T15:23:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![janaky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/janaky/32/88711_2.png) [@janaky](https://forums.unrealengine.com/u/janaky)\
**Post date:** [October 22, 2021, 3:23pm UTC](https://forums.unrealengine.com/t/the-ia-does-not-leave-eyes-the-player-ue4-c/490127/1 "2021-10-22T15:23:28Z")

</div>

’m coding an ia with a c++ behavior tree. My concern is the fact that must follow the player then if he sees it more that returns in the other sequences. So I used a UPawnSensingComponent and in my mycharacter.cpp: I put as code:

 ![350839-iihjo.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/0/9/c09da57ae5d164bd66b97f0ead525e2c690e66b1.png)

 ![350840-qrudm.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/f/5/ff59a9f2ca1564a2f428a249bba5ca0a34d93981.png)

and in mycontroller.cpp I added this to get my create variable in the blackboard:

![350851-hxejx.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/7/2/9725b8a5de17b2681839cde3d761d774d620181a.png)

here is my behavior tree to better understand:

 ![350838-8y7bz.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/e/02e8fbe8f54728dca0e7d1c79f8dab9497eaea34.png)

Thank you for your understanding and patience 🙂
