Toggle Bark UI based on camera distance
Posted: Thu Jun 22, 2023 11:52 am
Hi,
I would like to hide the Bark UI if the camera (not the player, but the camera) gets near and enable again if the camera gets further away, in case of the player it would be easy with triggers, sensors, but the camera has no rigidbody and no colliders either. What would be the ideal way to detect the distance between the camera and the bark UI (world space)? Do you have any recommendations? Or is there a built-in function by any chance to avoid situations when the camera gets very close to the bark UI in 3D space and basically blocks the whole view?
Thank you!
I would like to hide the Bark UI if the camera (not the player, but the camera) gets near and enable again if the camera gets further away, in case of the player it would be easy with triggers, sensors, but the camera has no rigidbody and no colliders either. What would be the ideal way to detect the distance between the camera and the bark UI (world space)? Do you have any recommendations? Or is there a built-in function by any chance to avoid situations when the camera gets very close to the bark UI in 3D space and basically blocks the whole view?
Thank you!