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
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!");
}