|
Hellow, 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" Thanks.
(comments are locked)
|
|
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: Well, seems there's no escaing doing it this way then. Thanks.
Oct 13 '10 at 06:55 PM
Oninji
(comments are locked)
|
|
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
(comments are locked)
|
|
If OnTriggerStay doesnt test for exit, there is no reason for exist, it is the same as OnTriggerEnter. First of all, this is not an answer to the question, so why do you post this as answer?. Second OnTriggerStay is not the same as OnTriggerEnter. OnTriggerEnter is called once when you enter the trigger. OnTriggerStay is called every frame while you're inside of the trigger. When you leave the trigger it isn't called anymore. Finally, when you want to ask a question, how about post a question instead of an answer...
Feb 24 '12 at 05:30 AM
Bunny83
(comments are locked)
|
