Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Make camera ignore everything behind portal

Discussion in 'General Graphics' started by SaulTapia, Sep 10, 2022.

  1. SaulTapia

    SaulTapia

    Joined:
    Sep 10, 2022
    Posts:
    2
    I'm making portals and the effect is pretty smooth, but I'm having trouble with objects that are behind the portal.

    I followed a tutorial and it basically works by placing a camera that imitates the movement of the player relative to the entrance, the problem is when there's an object behind the portal, and so the camera picks up on that, completely breaking the effect. How can I make the camera ignore everything that is behind the portal?

    I tried making a special layer so that it would get prioritized above all else and making a flattened cube with an invisible material, but clearly that didn't do the trick.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,455
    Use stencil portals. There are some guides on YouTube
     
    SaulTapia likes this.
  3. SaulTapia

    SaulTapia

    Joined:
    Sep 10, 2022
    Posts:
    2
    This is exactly what I was looking for, thanks a lot!
     
    DevDunk likes this.