# Multiple Line Trace Between AI and Player?

**URL:** <https://forums.unrealengine.com/t/multiple-line-trace-between-ai-and-player/431270>\
**Category:** AI\
**Tags:** line-trace, tiles, unreal-engine, question\
**Created:** [August 9, 2018, 6:46am UTC](https://forums.unrealengine.com/t/multiple-line-trace-between-ai-and-player/431270 "2018-08-09T06:46:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gavin\_Goulden](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gavin\_Goulden](https://forums.unrealengine.com/u/Gavin_Goulden)\
**Post date:** [August 9, 2018, 6:46am UTC](https://forums.unrealengine.com/t/multiple-line-trace-between-ai-and-player/431270/1 "2018-08-09T06:46:37Z")

</div>

Hey all - I’m trying to set up tile movement for my ai to path from point A to point B. For basic roaming, I am doing 4 traces (n,e,s,w) to get relevant tiles to move to and intentionally not moving in diagonal lines (like a 3d dungeon crawler.) This works fine for that purpose, but I’m hitting a wall when trying to make the enemy approach the player.

What I had in mind was to have the enemy see the player through pawn sensing and store the location. Between the enemies location and where they last saw the player, do a trace for every tile in an array…once the array is set, move to each index until reaching the final destination. Is it possible to do this? I have tried multiline trace, and of course can get the actors location - but am stumped on how to effectively do a trace downward for every tile in a line.

Beyond that, the more complicated scenario, is having a player on an angle then drawing a “best path” to them that avoids diagonal movement…

 ![249898-playermovebp-06.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/e/2/2e25c8bfe3cacf97593c7c86c359b8daa1e28232.jpeg)
