There is no audio in this video, so i encourage you to be your own DJ, listen to the music YOU like!
First of all, lets make two folders for the assets
One for blueprints
And one for the materials and scene captures
We will be using 2 portal blueprints for this project.
But i will only create 1 and then duplicate and rename  it
First add the two static meshes that we'll need
The plane's dimentions should be: x=2 y=0.9 z=1
Now add a Scene Capture 2D
Duplicate and rename
now for the material that the portal effect meshes will be using
Add a render target and open it up
I'm running at 1920x1080 resolution which is why i change these two values to that.
but you can use whatever values you want as long as it is in the same ratio as your computers resolution
Duplicate and rename
Now select the Scene capture for each render target
Portal 1 should have the portal 1 render target and vice versa
Forgot to edit that part out.. ups
Well.. now we create the materials for the two portals
Select them both, right click and create material
We do not want light to influence the look of the portal, which is why i make it an emissive material
Add a ScreenAlignedUVs node to make the texture align with you screen
And change the shading model to Unlit
Now do the same thing for the other material
Now we need to assign the two materials to the portals
we want the Scene Render from portal 2 to be displayed on portal 1
which means that the Portal 2 material will be assigned  to Portal 1 and vice versa.
Now we add a new blueprint to control the two portals
You  dont have to make a new blueprint, you could also write the code in the level blueprint, in one of the portals or maybe in the character blueprint, i just find it easier to do this way
The new blueprint is called BP_PortalManager
add 2 valuables, one for each portal
Remember to make the valuables editable
Create a function and call it in the event graph
we will duplicate this function later for the second portal
we will get the relative location between the two portals, by subtracting their positions from each other
now we add the player cameras location and rotation
We want the portal 2's scene capture to be moving relative to portal 1, that's why i am draggin in the portal 2 reference
set world location and rotation
add the two vectors and link the pins
now we have to drag in the Portal manager, and link the two portals
If you dont see the portals under the default tab, you might have forgotten to make the valuables editable in the Portal manager
as you can see, the portals are not quite lining up. this is because i am playing in the viewport, which may have a wierd ratio.
when playing in a new window with the correct ratio, the portals line up
we still need some work on the first portal before duplicating it
as you see, the current setup doesn't work when the portals are not lined up correctly
we will fix that now
i'm just making space for more nodes
Get the rotation of portal 2 and turn it 180 degrees on the yaw axis
We do this so that the camera is watching from behind the door, so the player looks through the door from the correct side
Need more space
we also need to get the rotation from portal 1
get the relative rotation by subtracting them, to do that use a delta node
now rotate the location vector from portal 1 so that the scene capture is moving relative to the other portal regardless of rotation
also do this for the player camera
Also connect the delta rotator like before, I simply forgot it
Rearranging again
ups, forgot to connect the rotator
to make the scene capture look the right direction, we have rotate its rotation too
Use a combine rotators node to achieve this
Thats it! the portal effect should now work for portal 1
and it does, great!
dynamic rotation also works
The effect is a little wobbly here, it's because the scene capture is following the player camera, which is linked to the players head, which is moving around, when playing, you wont see this
now we duplicate the function and switch portal 1 and 2 around
simply switch them around
Also change the Scene capture to Portal 1's
And remember to call this function too
just placing some objets to make the effect easier to see
You now have a cool looking portal effect!
These are the current limitations
Portals can (for now) only be rotated on the z-axis 
( Yaw-axis )
the portal effect cant be shown through another portal
And there is no object occlusion
which means that any object between the scene capture and the portal door, will be rendered in the portal. We dont want that.
However, i am very close to a solution for that problem!
That's it for now, hope you enjoyed the tutorial!
