It shows you how to enable and use the stencil buffer. I assumed that was your problem.
I don’t understand what this means.
For the portal you need a plane mesh and a material for it. The material for the portal itself is just an empty translucent material that is set to allow writing to the depth buffer (details panel of the material). The portal mesh should be set to not render in main pass and to render into the stencil buffer at a given index (these are in the details panel of the static mesh actor.)
You then create a translucent material for your object that reads from the stencil buffer to determine what areas are opaque vs. what is translucent. All of this was in that article, I’m just repeating it basically, so I don’t know if this is relevant to what you’re trying to accomplish. If your issue is with something else then you’re going to need to be a lot more specific…
Result:
I don’t know how it works in Unity but in UE4 you can’t read from the stencil buffer in a masked material, which means you have to use a translucent material. This makes it an expensive effect, and you’ll end up with the usual problems with translucent materials, namely you may get inconsistent lighting or sorting issues.