# Problem on lock on system

**URL:** <https://forums.unrealengine.com/t/problem-on-lock-on-system/479525>\
**Category:** AI\
**Tags:** npc, unreal-engine, lock, question\
**Created:** [February 27, 2021, 5:58pm UTC](https://forums.unrealengine.com/t/problem-on-lock-on-system/479525 "2021-02-27T17:58:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flameman182](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Flameman182](https://forums.unrealengine.com/u/Flameman182)\
**Post date:** [February 27, 2021, 5:58pm UTC](https://forums.unrealengine.com/t/problem-on-lock-on-system/479525/1 "2021-02-27T17:58:49Z")

</div>

Hello to everyone, I tried to prepare a simple lock on system but it doesn’t work unfortunately. Main idea of the code is making npc character to look at my main character when I get close enough. Can anyone help? Thanks. (First photo belongs to the main character and second one belongs to the npc ai).

 ![331112-photo-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/a/d/aadfaa4f4ffb278c2e9be2973937f0039d41bf25.png)

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [February 28, 2021, 2:55pm UTC](https://forums.unrealengine.com/t/problem-on-lock-on-system/479525/2 "2021-02-28T14:55:33Z")

</div>

Hello! You wrote that you want NPC to look at Main Character, but rotation code is inside Main Character BP… Maybe you want Main Character to target to NPC when he/she is near?
