- Home /
Occlusion Portal: Invalid Portal index
If i setup more than 5 OcclusionPortals in Unity, An "Invalid Portal Index" error is fired everytime the game starts.
Is anyone else facing this?
Answer by kmoosmann · May 09, 2014 at 09:03 PM
I might be late to the party, but yes, if you are using more than 5 occlusion portals in your scene, Unity will give you that error.
The good: The portals work as long as you don't intend to toggle them, you can disregard the error
The bad: You can't toggle them via script if you are using more than 5.
Workaround: Set up custom box meshes, make them static objects and use them as occlusion portals if you want to hide something specific (like another part of the level while you're on a hill or something). Bake them into the occlusion map, then disable the mesh renderers. With this method, you can control what can be seen - and you get to use your 5 occlusion portals that you can now toggle on/off (ex. for doors etc)
Hope this helps.