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 BimSekai · Aug 26, 2013 at 07:33 AM · nullreferenceexceptiontextfield

NullReference on textfield

Hello community,

I've encountered a very troublesome error recently, happens every time I edit a textfield... the textfield being in a window. Many people have this issue when not initializing the string for the textfield, mine is initialized... any ideas ?

 NullReferenceException: Object reference not set to an instance of an object
 UnityEngine.GUI.DoTextField (Rect position, Int32 id, UnityEngine.GUIContent content, Boolean multiline, Int32 maxLength, UnityEngine.GUIStyle style) (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/GUI.cs:601)
 UnityEngine.GUI.TextArea (Rect position, System.String text) (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/GUI.cs:453)
 RenameProjectPopUp.DrawChild () (at Assets/NewUI/menuAvril/RenameProjectPopUp.cs:15)
 IRCPopUp.doWindow (Int32 WindowID) (at Assets/NewUI/IRCPopUp.cs:253)
 UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/GUI.cs:1283)

Comment
Add comment · Show 4
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 TheRaven · Aug 26, 2013 at 07:36 AM 0
Share

Code please. Cant help without the code.

avatar image BimSekai · Aug 26, 2013 at 07:42 AM 0
Share

A very simple code wouldn't work neither.

string bob = "";

void OnGUI() { bob = GUI.TextField(new Rect(0, 0, 100, 30), bob); }

That's why I didn't post code ...

avatar image TheRaven · Aug 26, 2013 at 07:51 AM 0
Share

I pasted the code provided above into a cs file in my project and it runs fine, no errors. Just draws a textfield in the upper left corner. Perhaps the problem is else where.

avatar image BimSekai · Aug 26, 2013 at 08:12 AM 0
Share

I did the same and it worked on another project, what I mean is that there is a problem maybe with the default skin or something ? If I give another default value to the string it writes that value and I still can't change it. Still no ideas ?

1 Reply

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

Answer by BimSekai · Aug 27, 2013 at 07:09 AM

Okay, found it. I somehow modified the unity's default skin, and it had a problem with the font, causing the exception.

Comment
Add comment · 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

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

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Writing to txt file using textfield problem 2 Answers

C# Textfield Null Reference Exception 1 Answer

C# Another Null reference exception 1 Answer

EditorApplication.OpenScene causing NullReferenceException 1 Answer

Screen.currentResolution = Null? 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