Sorry for the noob question, but I am following a very easy tutorial about C# and getting a error, even copying the code and the same steps from the tutorial:
using UnityEngine;
using System.Collections;
public class ActiveObjects : MonoBehaviour
{
void Start ()
{
gameObject.SetActive(false);
}
}
And the error:
Assets/Scripts/ActiveObjects.cs(8,20): error CS1061: Type UnityEngine.GameObject' does not contain a definition for SetActive’ and no extension method SetActive' of type UnityEngine.GameObject’ could be found (are you missing a using directive or an assembly reference?)
Seems very simple to me and I don’t know why isn’t working.
Thanks ![]()
Yes, I don't know why it isn't working either! That's fine!
– whydoidoitWhat version of Unity are you using?
– whydoidoitIf you are using a version of Unity below 4.0, I believe, then that will not work. Instead you should use
– FLASHDENMARKSetActiveRecursively(false)You've got to name your questions better.
– Jessy