Search Unity

Check if object is fully visible to camera

Discussion in 'Scripting' started by theinfomercial, Sep 24, 2011.

  1. theinfomercial

    theinfomercial

    Joined:
    Sep 9, 2008
    Posts:
    1,000
    Hello. Does anyone know how to get an object to check if it's fully visible to the main camera? I suspect it has to do with the renderer's bounds, but have no idea how to check that against the camera's frustum.

    Thanks in advance!:)
     
  2. ev3d

    ev3d

    Joined:
    Apr 19, 2013
    Posts:
    327
    Bumping this cause it is a good question and comes upon google searches.. Anyone have an answer?
     
  3. Hyblademin

    Hyblademin

    Joined:
    Oct 14, 2013
    Posts:
    725
    I'm assuming that you've looked at the Renderer class's isVisible variable and that it doesn't suit your needs, since it isn't a check for a fully visible state.

    How flexible/precise do you need the check to be? I would try just calculating it using the transforms of the camera and target object as input.