Main Question:
I want to know if the object is visible in the camera view and if it can see, then how much screen space occupied by the object as a percentage
If the problem can not be solved in this way, then that’s my goal:
I want to get the Transform component of object with a specific tag (eg tag Apple) if it takes a lot of space on the screen, for example 25%
MFen
2
Question 1: if object is visible use
void OnWillRenderObject()
{
}
Question 2: … I will need more information, please view my comments, momentarily.
Ok, I’ve created a test scene with some example and an output label of percent of screen left. You should be able to derive from the script and example everything you need.[19292-determineviewarea.zip|19292]
Who do not understand, that is the meaning. Need to formalize the target rectangle and subtract the area of the screen and the rectangle of the target. Then calculate the percentage