Visible through walls?

Whats up everyone! I have an object that I want visible anywhere you are in the map. Similar to how demolition would play where everyone can see its location through walls and what not. I’m trying to make a billboard or text render visible through walls. Is there some way to achieve this? Or would I need to use a material set to the mesh? Or any other ideas?

Well, if your object is translucent, there is an option in the material details called ‘disable depth test’, which will render that translucent object literally on top of everything in front of it. I use it for UI stuff that inhabits the world all the time. Maybe that will help?

1 Like

Well my object isn’t translucent its a pick up item. Can i make a billboard or and other render component disable depth test? Or possibly a texture that i want to use as a billboard disable depth test? Like have my object in the level but use a billboard or something as a sign that players can see. Or how can i maybe pass it to screen space and have a distance count as you get closer to it. Something similar to other games where you need to get this object and the distance is displayed on screen or you can see it through the map.

If you set your mesh to use custom depth you can use post processing to draw an outline or solid color in the shape of your object on top of anything in the scene.

Is this only available in 4.9? Im using 4.8 and don’t want to update. I think I’ve looked for depth nodes in 4.8 and haven’t found certain ones displayed in the docs.

Nope it has been there for a while now.

Cool thanks! I’ll be doing some reading.

Its been some time since this was asked but, I wanted to offer up a method for anyone who may stumble upon this thread because being aware of many options is always good.

  1. If you wanted a more stylized approach, you can do outlines around your object in a custom depth pass, only when they are behind other objects (out of line of sight) with a post process material and post process volume, theres plenty of tutorials of that around but it is complicated.

  2. You could simply create a material and mark it as transparent which will allow you to set “Disable Depth Test” on the material, making it appear on top of every other object. However this will sacrifice many details the material could have since Materials that are transparent dont support the same quality of lighting and overall functionality as Masked/Opaque, etc. (unless perhaps in Forward Rendering mode but Im not entirely sure on that).

  3. Another option if you want to not use an outline, but rather make the whole object visible through a wall, but still allow it to use a non-transparent material, is you could have it toggle between its “normal” (in line of sight material), and a transparent material for when its out of line of sight. The easiest way is to do a simple LineTraceForObjects (or Visibility), and have it trace a line between your camera (Get Player Controller 0 > Get Player Camera Manager > Get Camera Location), and the actor’s world location that you want to see through a wall. Basically if the line trace returns with a hit, you just set the material to the transparent version so it suddenly shows up anywhere you are. If the hit fails, you set it back to normal material. Because the transparent material is separate, it also gives you opportunity to do literally any of your own stylized stuff to it, since its a material all on its own for that very purpose of allowing you to see it through walls. Can make it shiny, make it glow, make it a solid color a tint added to it, maybe even a tint based on distance or other variables, can get really creative about it indeed.

Anyway, those are some ideas that come to mind, I hope I can be of help to anyone.



I hame same question. Need to view my object only through the wall (and this object must has his original material).
I tried to use CustomDepth - SceneDepth on Opactiy to do transparent place on the material behind which I can see this object. But this object also visible if it’s not occluded by this wall.
How can I hide object in this case?

Usecase of this: a spatial crack from where creatures attack a player.

Thanks for any info.


Doing that requires rendering your Actor via a SceneCaptureComponent2D and displaying it via post-processing.

Here is the setup I use:


Add a SceneCaptureComponent2D inside your Camera component, and set it projection and FOV settings to match the camera ones. Also configure it to “Use ShowOnly List”, disable “Capture Every Frame” and “Capture on Movement”.
Create a new Material with the Domain set to “Post Process”, Blend Mode to “Translucent”, Blendable Location to “Before Tonemapping” and tick “Output Alpha”.

Create a TextureParam2D parameter in the material and name it “PlayerTexture”. The “PlayerTexture” output RGB channels should go into the final output “Emissive Color”, and the inverse A channel should go on the output “Opacity”.
On your Actor Blueprint, add the “Event BeginPlay” code to:
Create a RenderTarget2D with the Viewport resolution
Set the Target Texture from your SceneCaptureComponent2D to this recently created RenderTarget2D
Setup the SceneCaptureComponent2D to display only this Actor
Dynamically instantiate your previously created Material
Set this Material “PlayerTexture” param value to the previously created RenderTarget2D
Add this Material as a Blendable to your Camera [HR][/HR]

Also, add the “Event Tick” code to:
Disable your Actor rendering
Capture the Scene with SceneCaptureComponent2D manually
Re-enable your Actor rendering
[HR][/HR]You can see my Actor being displayed in front of everything even when it’s clipping the geometry:


thanks for this. It will help when i want to implement this feature in my game called Light Shine 'N Armor

If I click on “Post Process” in the material any other setting gets greyed out, am I doing something wrong?

use a shader that does not calculate the z buffer for the object you want to see through the walls.

The problem is that in my case it’s only HDRI in ue4 is visible not the walls.

Hey the screen capture method for me doesnt support AA because I think AA hapens only in the “final color” capture. Meaning the object has jagged edges. Any way around this?

edit: I think the setting you mentions “before tonemapping” would do that. Sorry havent my pc will give that a test later

For me the mesh rendered to the screen capture (which isn’t supposed to clip into the wall) is jittering using this technique.
Take a look here 2020 11 10 20 47 59 - YouTube
Also there is no shadow when hiding actor to render it to the screen capture.

Isn’t there like a legit way of solving this issue? :confused: How do AAA games solves this using UE4?

Normally, set the object to render in a custom depth pass with a custom stencil number, then color over the object in a post process material.
You can’t necessarily get the exact shading of the object, but that has to be expected since you are intersecting geometry and causing shadows.

Normally this process is used for outlines and similar effects.

if you want to render a solid object without light bending over another, i suppose you can set it to transparent and force the sort order. It would still be hit/miss.

I think the real solution is to mess with the depth rendering like for the initial thing I mentioned, but play with the stencil buffer and prevent the final image from painting the pixels that belong to the buffer so that the previous render is used… about a day of tweaking to figure out how to effectively do it, but definitely not by using a custom render.

BTW, a possibly better solution is to just push the vertex shared into the camera - not sure exactly what to base it on. perhaps distance to nearest surface could come in handy.

And the overall best solution for weapons is to just detect the collision and move the IK bone back which should drag your whole setup without compromising anything at all. On that note, Physical animation can actually work for this like it does for limbs clipping into the environment.

Hey, it’s me again.

So I have been playing around with an idea I got from here:…8742/view.html

I am essentially just scaling down the mesh and moving it closer to the camera. Besides the issue seen in the video, there are still other issues like near plane clipping when the scale gets to small.
This is what it looks like at the moment:

The code is available here as well:…hComponent.cpp

Any ideas?

I tried panini projection, but the gun managed to projected its own shadow onto itself from above. I tried masking it with custom depth / stencil, but then it started jittering when intersecting with walls.
And I also tried the ScreenCapture2D method, but here again, see my post from above, jitter hell.

I think next I will try to create a custom shader plugin and try to disable depth testing :confused:

Any input is welcome as I want to provide this information for future people struggling with this.

  1. Definitely adjust your collision. there is no reason you should be clipping into the wall from behind at all.

  2. instead of using panini projection I would simply use the same vector logic to shift the vertices away from the wall and allow SOME amount of clipping on very long weapons.

You can actually test how much clipping is occuring using a simple line trace off the socket of the hand pointed in the same forward vector of the weapon + a distance of 1000(1 meter). The hit result would always return a distance value that can be immidiately converted into the dynamic material AND/OR (which imho is better) the hand IK shift backwards.
This is bound to distort the model somewhat if you are looking into a mirror. But let’s be honest. games don’t really have mirrors or significantly good reflecting surfaces.

  1. Technically you can add collision to the weapon and make it interact with the environment (but not character capsule). to do that you have to properly set up the ragdoll PHAT, Create a Physical Animation Component on the chararacter, and play around with a slur of setups until you find the right one. Because the weapon is socketed and not part of the whole.…ile/index.html
    This is possibly the best solution, but it comes at the cost of completely loosing Aim in first person when touching a wall.

Pps: you are aware the pp material has several options for when during the processpit should be applied right?
changing that setting in the material may also stop flickering and sharp edges. Perhaps not for the render target because it takes physical time to write/read the RT. But still…

I recently figured out how to fix weapon clipping. I made a short video on it: Fix Weapon Clipping - UE4 FPS Camera [3/5] - YouTube
I hope that it might be helpful to others as well