Hi,
I´m trying to write a generic script for turning components on and off depending on if the player can do action X or not.
I´m starting basic and just making it based on time from start. This is what I have right now.
If I use the variable it gives me this error “Assets/activate script.js(6,13): BCE0023: No appropriate version of ‘UnityEngine.Component.GetComponent’ for the argument list ‘(UnityEngine.Component)’ was found.”. But if I type the name of the component it works just fine.
Is there a way to use a variable component so I can use this same script in multiple places?
Thanks fox, I retyped active and not enable so that was my mistake… Your script worked perfectly though. Thanks
One example of where I am putting this is when the player comes on screen. I don´t the player to have control right away until the avatar has done their entrance. This way the player has no control until the script is enabled.