I have been trying to use Renderer.IsVisible to create an enemy similar to SCP-173 from SCP Containment Breach, which moves when you look away. It works for the most part but if the enemy is positioned behind a wall or object which blocks the camera’s view of the enemy, it doesn’t move and the enemy still believes the camera can see it. I’ve never used .IsVisible before and I’m not sure exactly how it works or if this behavior is intended, however I can’t find any answers to these questions anywhere in the forums or documentation.
Any help would be appreciated.
Have you baked occlusion? Also UMBRA is a inclusive algorithm so it will render unseen things rather than not render visible things
You could always consider starting with the documentation Unity has provided. ![]()
It provides a lot of details to help you reason about its suitability to task.
Some form of casting (raycast or otherwise) will likely also be necessary for what you contemplate.
- It might be visible to a shadow casting light
- You might not have occlusion culling enabled
- Culling is conservative - it only guarantees that something that is visible on the screen is also rendered but not the other way around.
So as others have already said, you can’t use this flag for gameplay purposes unfortunately.