|
The "OnTriggerEnter" function, contained in a disabled script - is not supposed to execute on trigger event, I expect. Am I right?
(comments are locked)
|
|
It is supposed to execute in a disabled script (by design), and it does. Really the only thing that doesn't run in a disabled script is Update and OnGUI, maybe Start. Thanks. The answer confirms my experience. I had to use AddComponent(script) instad od enable/cisable script in order to get my scripts working. But it seems a bit confusing to me. Perhaps it should be stated somewhere in docs (if it is not)
May 02 '11 at 07:57 AM
tomekkie
@tomekkie: it's stated in the docs, somewhere. It should be stated in the MonoBehaviour.enabled section too, though, since it's not really clear. Anyway, you can do "if (!enabled) return;" in functions that you don't want to run if the script is disabled, rather than adding/destroying components.
May 02 '11 at 06:02 PM
Eric5h5
(comments are locked)
|
