Hi, i’ve got a quetion. I have a boolean in my script, and i want my boolean to be true, if the Camera looks in the direction of an object. I already tried
if(gameObject.renderer.isVisible)
{
boolean = true;
}
else
{
boolean = false;
}
but, everytime i do that, the boolean will return as true (in every situation).
Is there an other way, or am I doing something wrong?
What brian means is that if you're seeing the gameoject in the scene view renderer.isvisible will return true. Try turning the scene view to look into nothingness or compile a build.
– ExTheSeaOk now there are two options. 1. brian converts his comment to a question and you can accept it. 2. You close the question but please thumbs up brian's comment :)
– ExTheSea