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 Ochreous · Sep 25, 2012 at 12:37 AM · c#

How to display a string without ToString

Hi everyone, I've been trying to display a string without using the ToString Method. But I keep getting this error GUILayout.Button has invaild arguments.

 public string Text;
 
 void OnGUI(){
  GUILayout.Button(Text); // error GUILayout.Button has invaild arguments
 }
Comment
Add comment · Show 3
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 kmeboe · Sep 25, 2012 at 12:47 AM 0
Share

I don't have this problem. $$anonymous$$aybe the following will help us track this down:

1) What version of Unity are you running?

2) What is the exact error message? Do you see it when you build in $$anonymous$$ono, as well as when you try to run using the Unity player?

3) Can you paste the entire C# file for us, with usings and class definition?

avatar image Ochreous · Sep 25, 2012 at 01:10 AM 0
Share

Ok now it's working fine with no errors. A moment ago it was giving me an invaild argument error. Has anyone else had this issue? I'm using Unity's current version 3.5.5.

using UnityEngine;

using System.Collections;

public class TextError : $$anonymous$$onoBehaviour {

public string Text;

void OnGUI(){ GUILayout.Button(Text); // error GUILayout.Button has invaild arguments }

avatar image turtsmcgurts · Sep 25, 2012 at 03:51 AM 0
Share

I have noticed that I get Intellisense and compiler errors after switching between c# and javascript files in $$anonymous$$onoDevelop, the only fix I've found is simply restarting it.

1 Reply

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

Answer by Eric5h5 · Sep 25, 2012 at 12:47 AM

That code is fine and compiles and works with no errors.

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

12 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

Related Questions

unity c# RPC 0 Answers

Null Reference Exception on instantiated object's script. 2 Answers

adding animation dynamically by script 0 Answers

C# Gameobject Rigidbody Mouse Collision 1 Answer

Saving final score and displaying on main menu 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