Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How can i know when a gui element is no longer rendered by camera

Discussion in 'UGUI & TextMesh Pro' started by Ahmadhp, Dec 19, 2014.

  1. Ahmadhp

    Ahmadhp

    Joined:
    May 31, 2013
    Posts:
    33
    Hi,

    I wanted to know when a gui element ( like button ) is no longer rendered by camera. I know there is a monobehaviour event "OnBecameInvisible" that did this, but it is not working with new gui elements ( with canvas renderer ).
    So , any ideas ?
     
  2. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    you'll have to compare the element to the camera's frustum. We currently don't do that sort of processing.