Advice on portal clone (More cameras in 1 scene)

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

1 Answer

1

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!

The challenge comes in not clipping the plane that you're walking through. I have absolutely no idea how they accomplish that.

Yes, this is exactly what I want but its only available in Unity Pro. So I guess im stuck in the indie version?