Hello Guest

Author Topic: OnBecameInvisible() not working [Solved]  (Read 10639 times)

juts

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
OnBecameInvisible() not working [Solved]
« 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?
« Last Edit: May 12, 2013, 01:01:57 am by juts »

juts

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: OnBecameInvisible() not working
« Reply #1 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: OnBecameInvisible() not working [Solved]
« Reply #2 on: May 12, 2013, 12:35:49 pm »
Glad you've sorted it out, and thanks for sharing the info.