So. Generally I do well, i often struggle with new assets purely cos the guy showing them says click this, do that, and ive not even managed to click the first thing… and no matter how much screen space i have i need like 8 hands and 2 computers running one to run the video, and to halt, rewind, pause, etc… the others to do the unity/code editor potions… But…
Ive used occlusion culling before, Ive not had major issues but frankly I am questioning if 1+1=2 today.
See, see my complex scene setup
yes, 1 plane, 1 sphere, a light and a camera. Shocking isnt it
My occlusion settings
(and yes i baked)
TBH i feel like im at the stabbing in the dark stupid stage now so
the plane, light and camera, which dont move are all fully static
the plane has a navmesh and the navmesh is how the sphere moves
the sphere, which does move, is set as occluder and ocludee, why? cos well i thought ocludee but when it didnt work… maybe…
so
code wise? next to none
public class test : MonoBehaviour
{
public bool CanSeeMe { get; private set; }
private BehaviorTree behaviorTree;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
behaviorTree = GetComponent<BehaviorTree>();
}
private void OnBecameVisible()
{
CanSeeMe = true;
Debug.Log("Seen");
}
private void OnBecameInvisible()
{
CanSeeMe = false;
Debug.Log("Not seen ");
}
}
and while its not the behaviour tree code,
the stacked conditional is actually irrelevant - why, cos if the stupid variable was changing, it would work ![]()
So
the CanSeeMe, (as the renderer.isvisible wasnt… and i couldnt track it as easily so made my own)
the insanely simple principle being.
wander, if wandered off screen as so not visible, return to 0,0,0 and try again.
Only problem is, the OnBecameInvisible never fires until the game ends… Now, I am aware that this can be effected by the scene camera (annoyingly) so, its pointed at the sky during play. So that should not be an issue
dynamic occlusion is on the sphere renderer and occlusion culling enabled on the camera.
So why then is my stupid dumb sphere not realising its not visible any more… the “visibility lines” very much confirm when its off screen it should be off screen… (but you cant look at those without using the scene camera … ARGH)
Ive really had enough of fighting the up hill battles


