How to make a 3D Line of Sight System?

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

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

1 Like

this thread may help you

2 Likes

Lol thanks thatā€™s my post :smile:

lol

1 Like

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?

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?

maybe if you want ā€˜transparentā€™ assets you should move those assets to a different channel?

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

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.

1 Like

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

Alright, so first crack and hereā€™s what I have after completing section 3

Is that not what youā€™re seeing at that stage?

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!

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.

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

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.

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

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.

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!

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

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

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.