• 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 Etsamaru · Mar 29, 2015 at 07:04 PM · guinot workingup

Why isn't my Gui showing up at all?

I am following a tutorial, and the guy has his GUI showing up but mine is not showing up when I start the game.

 public void OnGui()
 {
     if (!connected)
     {
         connectionIP = GUILayout.TextField(connectionIP);
         int.TryParse(GUILayout.TextField(portNumber.ToString()), out portNumber);

         if (GUILayout.Button("Connect"))
         {
             Network.Connect(connectionIP, portNumber);
         }
         if (GUILayout.Button("Host"))
         {
             Network.InitializeServer(4, portNumber, true);
         }
     }
     else 
     {
         GUILayout.Label("Connections: " + Network.connections.Length.ToString());
     }
 }
 

}

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

1 Reply

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

Answer by supernat · Mar 29, 2015 at 07:05 PM

The method should be OnGUI, not OnGui.

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 Etsamaru · Mar 30, 2015 at 02:44 PM 0
Share

Thank you! I have no idea how I missed that at this point, It's usually the first thing I look for! Thank you for helping me with my hurdle, now I can continue to learn.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

MovieTexture stops playing after first frame 0 Answers

GUI Button not working...but the the script is correct... 2 Answers

Referencing a variable in another script possibly not working? 0 Answers

3.5 GUI not working? 1 Answer

GUI.anything not working 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges