Hello

Playing Portal 2 has been quite the experience as a game developer. What I was most interested in was making portals.

My idea is that you have 3 cameras:

  • One for the first person controller
  • One for portal 1 (Blue)
  • One for portal 2 (Orange)

Now when the I click on a surface (Cube or similar) with my right (Portal 1) or left (Portal 2) mouse button the camera moves to that spot (Using ray cast and transform.position).

This works, however since cameras are not rendered in game they cant actually be placed on my surface as portals but only as, well cameras..

Any advice on this or how it could be done?

This is how it looks as of now: alt text

I think they probably use render-to-texture. Each portal position is the position of a camera, but they show the render texture of the opposing portal.

The rendering part seems easy. Just think about having objects move through smoothly!