Occlusion only with "static" objects?

I read that all the objects to be occluded have to be marked as “static”. In my experience, static objects aren’t supposed to move and the colliders don’t function.

I wanted to use occlusion to be able to detect when people in my game are blocked by buildings, so that I can know they cannot attack the player (through the building), since that makes no sense. It seems that this will not be the way to be able to do this, since my people cannot function as static…

Thoughts on how to solve this? I only know I can shoot a ray from the person to the camera, and if it hits a building instead, they are blocked…but that could be expensive performance-wise.

you have to use raycasts to detect line of sight.

occlusion culling is for rendering only and yes its restricted to be occluded by static objects that can’t move cause the occlusion data are baked offline, they aren’t calculated in realtime (so even if you move the stuff, the occlusion does not care about it at all)