Hi!
I have some camera logic that does raycasting and tries to find an optimal place for the camera facing a building. This all works well, but my customers think the camera moves around to much.
so my though is that if I can check if the hitbox is not visible in the viewport, I’ll only do the animation then.
so if I click an apartment which is on the far side of the building the camera will animate.
but if the apartment is already in view, nothing will happen.
Try pressing on any of the units in either the list or 3d scene.
I found this example which seems do do what I want.
but it runs on every frame.
Is there a way I can do a one time operation and check if a mesh is visible in the viewport?