# 画面の中心に近い順に敵をロックオンできるようになりたい。

**URL:** <https://forums.unrealengine.com/t/topic/767905>\
**Category:** 日本語 (Japanese)\
**Tags:** unreal-engine, question\
**Created:** [February 10, 2023, 9:09am UTC](https://forums.unrealengine.com/t/topic/767905 "2023-02-10T09:09:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![29saidesu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@29saidesu](https://forums.unrealengine.com/u/29saidesu)\
**Post date:** [February 10, 2023, 9:09am UTC](https://forums.unrealengine.com/t/topic/767905/1 "2023-02-10T09:09:54Z")

</div>

操作キャラクターからコリジョンを出して、それに触れていてかつ、キャラクターに近い順にロックオンできるようにはしたのですが、これをコリジョンに触れていて、画面の中心に近い順にロックオンできるようになりたいのですが、どのようにしたら良いのでしょうか？  
色々と調べていますが、出てきません。

 ![スクリーンショット 2023-02-10 18.09.09](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/4/474413fe626ec9ef15eac5dcc13493658efd41ed.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 10, 2023, 9:18am UTC](https://forums.unrealengine.com/t/topic/767905/2 "2023-02-10T09:18:54Z")

</div>

> [@29saidesu](#):
>
> 操作キャラクターからコリジョンを出して、それに触れていてかつ、キャラクターに近い順にロックオンできるようにはしたのですが、これをコリジョンに触れていて、画面の中心に近い順にロックオンできるようになりたいのですが、どのようにしたら良いのでしょうか？  
> 色々と調べていますが、出てきません。

どうやら、これはそれを行います

> [@Line Trace from screen center to world](https://forums.unrealengine.com/t/line-trace-from-screen-center-to-world/295399/7):
>
> I guess that’s because the Z value you add is too low. Look in the components tab at what height your camera is and use this for the Z value instead of “Base Eye Height”.
