say I have 3 scripts called ,BOB,ABE,GUY
In script BOB, I want to enable ABE, and disable GUY… how could this be done in unity, using c#?
thank you.
say I have 3 scripts called ,BOB,ABE,GUY
In script BOB, I want to enable ABE, and disable GUY… how could this be done in unity, using c#?
thank you.
There are many similar questions already:
As allen said, there are already many questions for that.
Try using OnEnable and the setactive attribute, perhaps OnValidate would work to. Note that setactive also should work with getcomponent. Or was it awake… Just try those three, one should work I am not sure which one. (Awake, OnEnable, OnValidate).