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 tortgurt · Oct 25, 2011 at 03:16 AM · guierror

Can't troubleshoot this GUI bug

So I'm having an error that I shouldn't have at all as far as I know. the following code returns this error for each line of it.

 function OnGUI () {
     GUI.Box (Rect (0,0,100,50), "Top-left");
     GUI.Box (Rect (Screen.width - 100,0,100,50), "Top-right");
     GUI.Box (Rect (0,Screen.height - 50,100,50), "Bottom-left");
     GUI.Box (Rect (Screen.width - 100,Screen.height - 50,100,50), "Bottom-right");
 }

MissingMethodException: Method not found: 'GUI.Box'. Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.ProduceExtensionDispatcher () Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.Create () Boo.Lang.Runtime.RuntimeServices.DoCreateMethodDispatcher (System.Object target, System.Type targetType, System.String name, System.Object[] args) Boo.Lang.Runtime.RuntimeServices.CreateMethodDispatcher (System.Object target, System.String name, System.Object[] args) Boo.Lang.Runtime.RuntimeServices+c_AnonStorey12.<>m_6 () Boo.Lang.Runtime.DynamicDispatching.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key,

Any idea what I broke?

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 syclamoth · Oct 25, 2011 at 03:17 AM 0
Share

Could you tell us the filename of the script in question? It looks like it's trying to run it in Boo, but what you've written looks more like javascript!

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by syclamoth · Oct 25, 2011 at 03:22 AM

Could you tell us the filename of the script in question? It looks like it's trying to run it in Boo, but what you've written looks more like javascript!

Just on a hunch, what happens if you replace it with this-

 import UnityEngine
 import System.Collections
 
 class example(MonoBehaviour):
 
     def OnGUI():
         GUI.Box (Rect (0,0,100,50), 'Top-left')
         GUI.Box (Rect (Screen.width - 100,0,100,50), 'Top-right')
         GUI.Box (Rect (0,Screen.height - 50,100,50), 'Bottom-left')
         GUI.Box (Rect (Screen.width - 100,Screen.height - 50,100,50), 'Bottom-right')

I'm not so good at Boo, but if that compiles then it means that you're using the wrong file extension on your script file.

Comment
Add comment · Show 2 · 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 Eric5h5 · Oct 25, 2011 at 05:01 AM 0
Share

The Boo references are just because Unityscript is written in Boo.

avatar image syclamoth · Oct 25, 2011 at 05:03 AM 0
Share

I thought it was something like that. Which honestly makes more sense the more I think about it.

avatar image
0

Answer by tortgurt · Oct 25, 2011 at 03:54 AM

It's a .js file. GUI.js to be specific. I checked again to make sure I wasn't just blind to the problem. The code compiles, it just shoots me run time errors all day.

Comment
Add comment · Show 3 · 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 syclamoth · Oct 25, 2011 at 03:56 AM 1
Share

Please, use comments for comments.

Well, that's your problem then! Your 'GUI' filename is overriding the UnityEngine.GUI type! Change the name of your file, or, if it's completely necessary for you to call it that, explicitly call UnityEngine.GUI.Box in all those lines, and see if the problem goes away.

avatar image tortgurt · Oct 25, 2011 at 04:11 AM 0
Share

Oh my, that was the right answer. I just couldn't figure out what went wrong. Thankss for the help!

avatar image thesfid · Sep 11, 2013 at 01:58 PM 0
Share

This happened to me too.

@syclamoth make this an answer.

avatar image
0

Answer by AltIvan · Jul 20, 2014 at 02:21 AM

Your 'GUI' filename is overriding the UnityEngine.GUI type! Change the name of your file, or, if it's completely necessary for you to call it that, explicitly call UnityEngine.GUI.Box in all those lines, and see if the problem goes away.

(answer by @syclamoth, not me)

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

6 People are following this question.

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

Related Questions

[Solved] GUI Error? 1 Answer

Error: Optimized GUI Block text buffer 4 Answers

Wearied Error 1 Answer

Can I use the new GUI system with instantiated prefabs? 1 Answer

Unity UI flickering 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