Check if part of an object is outside of Camera View

Hi guys!

I want to check in my Scene if a GameObject is partially or completely outsite of my Screen View. With WorldToScreenPoint Im already logging if the transform.position (= middle point) is outside of the camera. The problem is, that I also want to log if some part of the Object is outside. I hope you undestand my problem, if not feel fre to aks :slight_smile:

Code:
void Update() {
Vector3 playerOnScreenPos = cam.WorldToScreenPoint(gameObject.transform.position);

    if (playerOnScreenPos.x < 0 || playerOnScreenPos.x > Screen.width ||
        playerOnScreenPos.y < 0 || playerOnScreenPos.y > Screen.height)
        Debug.Log("Outside!");

}

@dbrandauer You may want to take a look at the following pages from the API: Unity - Scripting API: MonoBehaviour.OnBecameVisible()
Unity - Scripting API: MonoBehaviour.OnBecameInvisible()
Both are methods that are called when the object gets seen / unseen by the camera. In terms of an object being “partially” inside or outside the camera view, this is harder. What I would do is maybe create two or more different objects that are children of the object you care about being fully visible, and count the parent object as fully visible only if all of its children are visible.