How can I create a ceiling that disappears in the way of a camera?

I’m trying to make an isometric camera setup for a game and everything’s going well, but one thing has got me stumped. How would you go about making ceilings disappear from architecture when it gets in the way of the camera and the player? I wanted a setup similar to stuff like the old XCOM games, or like the one recently implemented in Dragon Age, Wasteland 2 etc. Do you just make any mesh that gets in between the camera and the player invisible? Does this mean that my ceiling meshes have to be separate objects? If so, can anyone kindly give me an idea how to implement this? Thanks.

If anyone’s interested I played around a bit with the Dragon Age’s camera system. I think they build buildings modularly in such a way that wall panels and ceilings disappear when you enter Tactics Mode. But if anyone can point me to any documents as to how BioWare did it, I would greatly appreciate it!

Well… You could have a bunch of meshes that make up the ceiling, (you create a blueprint that spawns them in a certain size which you can change in level creation) and you then make a translucent material which gets applied to all of them (the material of which you can also set in level creation) then using getdistanceto you fade out any meshes within a radius of the camera.

If you want I can create the blueprint for you so you can see what I mean? Hope this helps. :slight_smile:

P.S. ask me if you need any further help :slight_smile:

Okay! That would be a great help! Thank you btw!

Here it is :slight_smile:

Took me a while, but you are free to use it in whatever you want :slight_smile:

It’s fully featured so since you’re a beginner you shouldn’t have to change anything, and you might be able to learn some stuff from it :slight_smile:

(If you think my answer is good, could you please click the tick next to it?)

Nice script - but I need help in applying it.

What I want to archive is the following: I have a fixed camera position and a pawn that can be moved through the level by mouse clicks. At some points it is hidden behind objects - and at that times those objects should become lookthrough so the player always sees the pawn, even if it is behind an object. I thought I could apply your script to this, but it does not seem to do the trick. Can you help me with that?

You should just be able to drag it into your scene, set the mesh and the width and all that, and it should just begin to dissapear when the camera gets within the specified radius. :slight_smile:

PS. Make sure to read the tooltips I’ve put for the variables :slight_smile:

Continually Line trace, or perhaps sphere trace to get some breadth in your trace, between your character capsule and your camera. If it collides with something, pull hit actor and hide that actor.

Hi TMkaekler,

You can try using location based opacity and changing the world position of the opacity based on camera location. Some of the stuff you would need to help you can be found here: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums