I have been reading similiar posts and the answers havent been working out for me so Im posting a question with my code and hopefully someone will see what Im doing wrong cause Im sure its something small.
Its a enter a vehicle script. The script to fly the plane is on the “Jet” object in the hierarchy, it has a child gameObject, a trigger box to enter and start flying the plane. On that trigger box is where this code is.
ERROR: BCE0019: ‘enabled’ is not a member of ‘UnityEngine.Component’
Here is the line that Im getting the error on and allows me to find the Jet named object in Heirarchy and turn on the Flight Controls script which is disabled.
GameObject.Find(“Jet”).GetComponent(“Flight”).enabled=true;
GameObject.Find(“Jet”).GetComponent(“Flight”).enabled=false;
The second line is on the other side of the else if statement when im getting out of the plane and need to turn off the plane controls and use the players controls again.
Hopefully Im just being a noob and you guys can see the problem.
Thanks
Thank you so much, that worked. I thought it had to be string cause it was a script or something, i dont know im new at this but thanks a lot for the quick response.
– NinjaDesigns