Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Dissolver84 · Jun 14, 2012 at 11:34 AM · guierrorerror-handling

GUI error scripting help!

I've created this script to open a GUI Texfield. But there is an error in my script... error: "Assets/Scripts/TypeName.js(2,16): BCE0018: The name 'TextField' does not denote a valid type ('not found')"

Here is the script:

 var stringToEdit : String = "Type in your NAME";
 var TextArea : TextField;
 
 function OnGUI () {
    stringToEdit = TextArea.text;
 }
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image kolban · Jun 14, 2012 at 01:13 PM 0
Share

I may be very wrong here, but have a review of the following question and answer and see if this assists:

http://answers.unity3d.com/questions/264120/how-do-i-keep-a-reference-to-editor-gui-objects.html

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by flamy · Jun 14, 2012 at 11:48 AM

hmmm TextField is not a class to so that you can declare a object for it, it is just a function in unity. you can call a function but not declare it as a type for a variable. From the method what i understand you are trying to do something like this...

 var stringToEdit : String = "Hello World";
 var viewportArea : Rect;
 
 function OnGUI () {
     // Make a text field that modifies stringToEdit.
     stringToEdit = GUI.TextField (viewportArea, stringToEdit, 25);
 }

is this what you want ???!!

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dissolver84 · Jun 14, 2012 at 02:13 PM 0
Share

Yes!! That was what I actually want! Thanks! :) edit: I tried the script but it keeps saying the same error.

avatar image
0

Answer by Dissolver84 · Jun 16, 2012 at 02:41 AM

I still get the same problem, any help?

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Wolfram · Jun 16, 2012 at 02:52 AM 0
Share

You are indeed using @flamy's script, and replaced all the code that was in your script? The error message really refers you to that script? Which line? (double-click the error in the Unity console).

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

"NullReferenceException" while trying to draw a texture (C#) 1 Answer

Why is the script rejecting me? 1 Answer

script connection 1 Answer

Is there an easy way to pop-up error messages 3 Answers

Helicopter script error 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges