# How to make a 3D Line of Sight System?

**URL:** <https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815>\
**Category:** Blueprint\
**Tags:** Perception, unreal-engine, UE5-0, Blueprint, question\
**Created:** [June 8, 2022, 8:39am UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815 "2022-06-08T08:39:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pheonix00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pheonix00](https://forums.unrealengine.com/u/Pheonix00)\
**Post date:** [June 8, 2022, 8:39am UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/1 "2022-06-08T08:39:43Z")

</div>

How can I create a full 3D version of the following Line of Sight System:

> **[TUTORIAL: Line of Sight Visualizer for Unreal Engine](https://hippowombat.medium.com/tutorial-line-of-sight-visualizer-for-unreal-engine-f32113b1f6f3)**
>
> Intermediate Tutorial

It has to take height/elevation into account and be able to look something like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/e/f/fef80adad4bbb9a3c9bd6713fd200c3e3bea3495.jpeg)

---

<div class="post-metadata">

**Author:** ![eldany.uy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eldany.uy/32/821920_2.png) [@eldany.uy](https://forums.unrealengine.com/u/eldany.uy)\
**Post date:** [June 8, 2022, 10:45am UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/2 "2022-06-08T10:45:48Z")

</div>

this thread may help you

> [@How to Line Trace in all directions?](https://forums.unrealengine.com/t/how-to-line-trace-in-all-directions/572301):
>
> How can I do a line trace outwards from a characters head in all directions creating a perfect sphere of line traces? Please show with blueprint example and explain like I’m 5, thank you!

---

<div class="post-metadata">

**Author:** ![Pheonix00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pheonix00](https://forums.unrealengine.com/u/Pheonix00)\
**Post date:** [June 8, 2022, 4:04pm UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/3 "2022-06-08T16:04:37Z")

</div>

Lol thanks that’s my post 😄

---

<div class="post-metadata">

**Author:** ![eldany.uy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eldany.uy/32/821920_2.png) [@eldany.uy](https://forums.unrealengine.com/u/eldany.uy)\
**Post date:** [June 8, 2022, 4:35pm UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/4 "2022-06-08T16:35:23Z")

</div>

lol

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/f/bbfd837d409d026b5973bcf2c5c313293cb8d61a.jpeg)

---

<div class="post-metadata">

**Author:** ![eldany.uy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eldany.uy/32/821920_2.png) [@eldany.uy](https://forums.unrealengine.com/u/eldany.uy)\
**Post date:** [June 8, 2022, 5:14pm UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/5 "2022-06-08T17:14:29Z")

</div>

Just thinking…you want to make a sphere ray to sense stuff in the scene…

I would like to ask you:…do you have SO MANY stuff to evaluate? I mean…suppose you have 50 enemies in the scene…is not better to focus traces in the relevant directions instead making a 360 degrees review?

---

<div class="post-metadata">

**Author:** ![gh0stfase1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gh0stfase1/32/1194639_2.png) [@gh0stfase1](https://forums.unrealengine.com/u/gh0stfase1)\
**Post date:** [June 8, 2022, 5:36pm UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/6 "2022-06-08T17:36:32Z")

</div>

I’m slightly confused. The tutorial you linked appears to do everything you’re asking for except for making the wall transparent…including taking into account height/elevation.

What am I missing or misunderstanding?

---

<div class="post-metadata">

**Author:** ![eldany.uy](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eldany.uy/32/821920_2.png) [@eldany.uy](https://forums.unrealengine.com/u/eldany.uy)\
**Post date:** [June 8, 2022, 5:43pm UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/7 "2022-06-08T17:43:28Z")

</div>

maybe if you want ‘transparent’ assets you should move those assets to a different channel?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/2/5/e253ebac7c934d47748d5dd6059e940a02a7bafc.png)

---

<div class="post-metadata">

**Author:** ![Pheonix00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pheonix00](https://forums.unrealengine.com/u/Pheonix00)\
**Post date:** [June 8, 2022, 5:54pm UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/8 "2022-06-08T17:54:54Z")

</div>

I followed that tutorial exactly and triple checked everything but in the end I end up with a white screen and the post process not working the way as needed. I dont what I am missing but I would love for the tutorial to work so I can test my use case. But also, it doesn’t seem like it takes height/elevation into account, it only does a top XY Mask. It was made for 4.25 and I’m on 5.0 so maybe that’s causing an issue? Idk man i really want this to work and I cant seem to find any proper help short of hiring a programmer lol

---

<div class="post-metadata">

**Author:** ![gh0stfase1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gh0stfase1/32/1194639_2.png) [@gh0stfase1](https://forums.unrealengine.com/u/gh0stfase1)\
**Post date:** [June 8, 2022, 6:14pm UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/9 "2022-06-08T18:14:51Z")

</div>

Ok, I think I’m picking up what you’re putting down…the tutorial is creating the illusion of height visibility.

A shame that you can’t get the tutorial to work out, as the illusion might be good enough for your purposes. I’m using 5.0.2 as well so I’m going to give the tut a shot just to learn a thing or two as there appears to be valuable information/techniques here. I won’t have an editor in front of me until later tonight but, if this hasn’t been resolved by then I’ll give it a shot and report back.

On a side note, you’re not running a configuration which might have turned off a post-processing feature you need to replicate the tutorial correct? Meaning you’re not running with some default mobile build that turns off certain PP features.

---

<div class="post-metadata">

**Author:** ![Pheonix00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pheonix00](https://forums.unrealengine.com/u/Pheonix00)\
**Post date:** [June 8, 2022, 7:38pm UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/10 "2022-06-08T19:38:34Z")

</div>

That would be cool, yeah check it out and see if you can get it to work for you. I’m stuck on “Step 3: Capturing ISM Visualizer to Render Target”, everything before that is working fine, but during/after this step is where the problem starts for me. My render target texture is not picking up the inverted red/black (before it was, but final result was still wrong).

No the project is setup for desktop maximum quality

---

<div class="post-metadata">

**Author:** ![gh0stfase1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gh0stfase1/32/1194639_2.png) [@gh0stfase1](https://forums.unrealengine.com/u/gh0stfase1)\
**Post date:** [June 9, 2022, 1:37am UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/11 "2022-06-09T01:37:23Z")

</div>

Alright, so first crack and here’s what I have after completing section 3

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/2/0/a2058cf1660f3520f4f472bb49f86a4a3bfa3e53.jpeg "2022 06 08 21 32 23") ](https://www.youtube.com/watch?v=U5AHRn1aapQ)

Is that not what you’re seeing at that stage?

---

<div class="post-metadata">

**Author:** ![Pheonix00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pheonix00](https://forums.unrealengine.com/u/Pheonix00)\
**Post date:** [June 9, 2022, 1:40am UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/12 "2022-06-09T01:40:09Z")

</div>

No I am not, I was seeing that before but it went away, I dont know what happened. You’re using 5.02 right?

EDIT: I must be missing something, but I’ve checked everything so many times I’ve lost count!

---

<div class="post-metadata">

**Author:** ![gh0stfase1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gh0stfase1/32/1194639_2.png) [@gh0stfase1](https://forums.unrealengine.com/u/gh0stfase1)\
**Post date:** [June 9, 2022, 1:44am UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/13 "2022-06-09T01:44:30Z")

</div>

Yeah, 5.0.2. You say “it went away”…can you check your BP\_SightLine actor that you placed in the scene and make sure the “OffsetByHeight” flag is checked? If it’s unchecked I end up with a black render target.

---

<div class="post-metadata">

**Author:** ![Pheonix00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pheonix00](https://forums.unrealengine.com/u/Pheonix00)\
**Post date:** [June 9, 2022, 2:56am UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/14 "2022-06-09T02:56:45Z")

</div>

yeah its checked, is your classtofollow set to the thirdpersoncharachter? and is the texture object in the material function set to RT\_SightLineCapture?

---

<div class="post-metadata">

**Author:** ![gh0stfase1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gh0stfase1/32/1194639_2.png) [@gh0stfase1](https://forums.unrealengine.com/u/gh0stfase1)\
**Post date:** [June 9, 2022, 3:06am UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/15 "2022-06-09T03:06:32Z")

</div>

No, my class to follow is just set to character (because the 3p character bp is a subclass of it).

Here’s a zip of the project I have after stage 3 is complete. See if that works for you.

> **[LightOfSight.zip](https://drive.google.com/file/d/1cKsXQI7J8Cklx3GYRURMTlW91z9MP9dF/view?usp=sharing)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![Pheonix00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pheonix00](https://forums.unrealengine.com/u/Pheonix00)\
**Post date:** [June 9, 2022, 3:09am UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/16 "2022-06-09T03:09:48Z")

</div>

ok I managed to figure what was wrong with step 3, I had the wrong material on the 3DSlice Mesh, so now I am getting the red/black rt\_targetrender

EDIT: next problem is getting the post process to work correctly

---

<div class="post-metadata">

**Author:** ![gh0stfase1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gh0stfase1/32/1194639_2.png) [@gh0stfase1](https://forums.unrealengine.com/u/gh0stfase1)\
**Post date:** [June 9, 2022, 3:20am UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/17 "2022-06-09T03:20:02Z")

</div>

Money, glad that worked out. Let me know if you have issues with the post-processing side and I can cross-check functionality. Eager to know if this works out for you.

---

<div class="post-metadata">

**Author:** ![Pheonix00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pheonix00](https://forums.unrealengine.com/u/Pheonix00)\
**Post date:** [June 9, 2022, 3:23am UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/18 "2022-06-09T03:23:59Z")

</div>

Thanks, oh yeah I mean I’ve finished the rest already, and still not working. I’m getting a white screen the moment I plug in the post process material. If you could finish the rest and check, that would be super helpful!

---

<div class="post-metadata">

**Author:** ![Pheonix00](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pheonix00](https://forums.unrealengine.com/u/Pheonix00)\
**Post date:** [June 9, 2022, 3:56am UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/19 "2022-06-09T03:56:01Z")

</div>

Ok I got it! (Kind of), I had to make my own tweaks. I put the post process material in my thirdperson camera. I put a inverse node (1-) in the material function, in two places. First is right at the end before the output result node and second place is at the end of the “samples RT from worldspace” section between the saturate node and the alpha lerp

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/f/f/2fff43036282f8a48cc68c301f12b1ebe2673b4b.jpeg)

only thing is though, as you can see in the tutorial, if tracehitoffset is at 1, it gives these artifacting black lines but if you set it to 1.1 like he suggests, it makes other side of walls lose the blackness as you move away. you can see it in the picture happening on the left wall

EDIT: lemme know when youre done, I want to see if we can tweak the system

---

<div class="post-metadata">

**Author:** ![gh0stfase1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gh0stfase1/32/1194639_2.png) [@gh0stfase1](https://forums.unrealengine.com/u/gh0stfase1)\
**Post date:** [June 9, 2022, 4:49am UTC](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815/20 "2022-06-09T04:49:00Z")

</div>

Hot d\*mn, nice work. I stepped away but one thing to consider is making the “CheckRange” on the BP\_SightLine actor larger. It’s currently set to 4000 but it’s possible that your far left wall there extends beyond that when you walk away. You could verify if that’s the case or not by turning the line trace debug back on.

[Next page](https://forums.unrealengine.com/t/how-to-make-a-3d-line-of-sight-system/576815.md?page=2)
