Like the title say, is there a function that is inverse to OnTriggerStay? I need to detect when the object is inside and when it's outside.
Or can I divide the function to tell it that when it's on True do "X thing" and when False do "Y thing"
asked Oct 13 '10 at 06:38 PM
No, there is no OnTriggerOutside or some such.
OnTriggerStay is called once per frame just as Update is. Using OnTriggerEnter and OnTriggerExit, you can achieve what you describe via a boolean flag:
answered Oct 13 '10 at 06:46 PM
it is not enough, not always, for exemple, in some circunstancy you miss the moment of "OnTriggerExit" for some complex reason such as parenting, the "stay" will be still confirmed. Actually if there is not the reverse effect, there is no reason for "OnTriggerStay", it would be the same thing of OnTriggerEnter