2D Toolkit Forum

2D Toolkit => Support => Topic started by: juts on May 12, 2013, 12:53:37 am

Title: OnBecameInvisible() not working [Solved]
Post by: juts on May 12, 2013, 12:53:37 am
I've got a scene set up using TK2DCamera with an ortho size of 512.  I have a sprite thats 1280x3000 that scrolls off the screen by incrimenting its transform.position.y.  For some reason when the sprite is fully off the screen OnBecameInvisible is never triggered. The code for it is below, it never gets called.

Code: [Select]
void OnBecameInvisible()
    {
        Debug.Log("it got herre");
        enabled = false;
       
    }


Any Ideas?
Title: Re: OnBecameInvisible() not working
Post by: juts on May 12, 2013, 12:57:23 am
Haha... nevermind. The unity editor thinks its a camera and because i had it open in a scene view it was never 'invisible".  Silly renderer.
Title: Re: OnBecameInvisible() not working [Solved]
Post by: unikronsoftware on May 12, 2013, 12:35:49 pm
Glad you've sorted it out, and thanks for sharing the info.