- Home /
Duplicate Question that has been asked (and answered) too many times before. Use the search function or Google.
Errors when trying to enable script on gameobject.
Hello I have ran into a problem with enabling a script on a gameobject; here is my code.
hit.collider.gameObject.Find("Draw").GetComponent("YAnimator").enabled = true;
I have tried it in many ways without the find function and without the quotes and it doesn't seem to work I have even tried it without the hit.collider and just the gameObject and it keeps bringing up this error.
Assets/Standard Assets/created/OpenDraws.js(54,96): BCE0019: 'enabled' is not a member of 'UnityEngine.Component'.
Any help it is annoying me! D:
and also I have tried GameObject.Find("Draw").GetComponent("YAnimator").enabled = true;
Follow this Question
Related Questions
Enabling/Disabling Multiple Tagged objects 1 Answer
gameObject.GetComponent("Script").enabled = true not working 5 Answers
Gameobject script enable weird behavior 1 Answer
one shot Sound on collision. Unity 4.0 problem. 2 Answers
Assign a 'Transform' target to prefab by finding a 'GameObject' 1 Answer