Question by
Ramondv · Mar 26, 2019 at 06:45 PM ·
c#scripting problemselecting objects
disable and enable a script on multiple other game objects
So i've been looking for an correct anwser for a long time now, but all i can find is solutions dated from 2012 or below.
My problem is: i have a script that's on multiple other elements(with the same tag) and i want to disable and enable that from my button script(that's on a button gameobject and doesn't have any other script on it). but i don't know how.
I have code like this:
public void OnButtonDown(Hand fromHand)
{
ColorSelf(Color.yellow);
fromHand.TriggerHapticPulse(1000);
GetComponent(resetPos).enabled = true;
}
Wich is most of the code provided by Valve Corporation. But i've tried adding the GetComponent to select the other scripts from the same game object this script is on(just to see if the getcomponent worked), but even that doesn't work. so im lost.
Comment