Fog Hider
Hides an object while no Vision Source of a team can see it, for example enemies and items in the fog of war. Sprites fade out and back in; other renderers switch off and on. A Fog Hider works without a Fog Of War too: it only needs Vision Sources of its team.

Settings
| Setting | Default | Description |
|---|---|---|
| Shown To Team | 0 | The object is visible while a Vision Source of this team sees it. Usually the player's team |
| Stay Visible Once Seen | Off | Once seen, the object stays visible. For buildings, landmarks and terrain features. Leave it off for units |
| Fade Speed | 8 | How fast sprites fade in and out. 0 = instantly |
| Visible Points | Empty | Optional points to test, e.g. the corners of a large building. The object is visible if any of them is seen. Empty = the object's position |
Runtime
In Play mode: whether the object is visible now and whether it was ever seen.
What gets hidden
The hider controls all renderers on its object and its children: sprites, meshes, tilemaps, particles, cones. Sprites fade by changing their color's alpha, starting from the alpha they had when the hider was enabled. Other renderers switch off at half fade.
Some things to keep in mind:
- An enemy's own Vision Cone Renderer is hidden together with it. If the cone should stay visible, for example in a stealth game where the player sees guards' cones through the fog, put the Fog Hider on the sprite child instead of the root.
- A hider on an object with its own Vision Source of the same team always sees itself and is never hidden. The Inspector warns about this.
- If no Vision Source of the team exists, the object is always hidden. The Inspector warns about this too.
- If you change a sprite's alpha from your own scripts, the hider overrides it. Call
RefreshRenderers()after adding or removing renderers or colliders at runtime.
The object's own colliders never hide it, the same as for Vision Target.
Scripting
Namespace Renvix.VisionFog.Presentation.
| Member | Description |
|---|---|
bool IsVisible | Seen by the team in the latest update |
bool WasSeen | Ever seen by the team |
int ViewerTeam | The team the object is shown to |
void RefreshRenderers() | Re-reads renderers and colliders under the object |
// Show an enemy marker on the minimap only while the enemy is visible.
marker.enabled = hider.IsVisible;