Pass ForgeDocs Product page

How do I

Keep the player visible behind walls

Add Pass Forge Occluder Fade to the player; walls, roofs and trees between the camera and the player get a soft dithered hole, and sprites in the way fade.

You want

In your top down or isometric game, the hero walks behind a building and vanishes. You want a see-through hole in the wall around the hero instead.

Steps

  1. Select the player and add Add Component > Pass Forge > Occluder Fade. The Effect Presets window's Objects tab also has Add Occluder Fade To Selection.
  2. Leave Camera empty to use the main camera.
  3. Set Target Offset to the point to keep in view, such as the middle of the character. It starts at one meter up.
  4. Set Radius, the size of the hole as a share of the screen height, and Softness, the share of the radius over which it fades.
  5. Set Layers so the ground is left out and the player's footing stays solid.
  6. For a 2D game, set Sprite Opacity, how much of a sprite in the way still shows, and Sprite Fade Time.
Inspector
Occluder Fade Inspector

What you should see

Objects drawn with a Mesh Renderer between the camera and the player get a soft hole around the player. Only what is nearer the camera than the player is cut: a wall the player stands in front of stays whole, and so does the far part of a building the camera looks through. It needs no colliders.

Sprites in the way fade to Sprite Opacity by their color's alpha, so they keep their material, and come back once they no longer cover the player.

If it does not work

  • A character or terrain stays whole. Occluder Fade cuts objects drawn with a Mesh Renderer. Skinned Mesh Renderers, Terrain and trees painted on a Terrain stay whole.
  • The floor under the player gets a hole. Leave the ground's layer out of Layers.
  • A sprite behind the player fades. With a Sprite Renderer on the player, a sprite counts as in the way when it is drawn after the player in the 2D sort and reaches into the circle of Radius. Check the sorting layers and orders.
  • The build says the Lit Effects shader is missing. Tick Dissolve, Occluder Fade And Cross Section Added From Scripts under Project Settings > Pass Forge when a script adds the component while the game runs.