Search Issue Tracker

Fixed

Votes

4

Found in

4.6.1f1

Issue ID

657632

Regression

No

[Callbacks] When disabling renderer on one object, OnBecomeVisible is called on the last created object

Graphics - General

-

Steps to reproduce this issue:

1. Open the attached project
2. Open 'Test' scene
3. It has 3 objects which logs OnBecameVisible() and OnBecameInvisible and script
which disables one of the object renderers when clicking E button
4. Play the scene
5. Notice it outputs in the console when objects become visible
6. Press E
7. 'C' cube should disappear
8. Invisible C is indicated. Which is expected
9. Visible A is indicated again. Which is not expected.

It will call OnBecameVisible on the last gameObject created that has OnBecameVisible implemented on it
If you:
1. change 'RenderToTest' to the last object created ( A cube ) and
2. repeat 4-7 steps again. Now everything works fine as you disable the last created object

Comments (2)

  1. Crazydadz

    Dec 19, 2014 22:40

    just do* these really simple steps

  2. Crazydadz

    Dec 19, 2014 22:37

    At the moment, to avoid this issue just to these really simple step. http://answers.unity3d.com/questions/853879/onbecamevisible-called-out-of-nowhere.html#comment-858045

Add comment

Log in to post comment