GUI shows up on editor but not after building running

Well I added a GUI toolbar to my scene, by creating an empty game object and attaching this script to it:

/* GUI.Toolbar example */

var toolbarInt = 0;
var toolbarStrings : Texture[];
var Buttonbg : GUIStyle;

function OnGUI () {
	toolbarInt = GUI.Toolbar (Rect (10, 560, 310, 30), toolbarInt, toolbarStrings, Buttonbg);
	
}

If i run the game through the editor the GUI shows up and everything seems perfect, but if I “Build Run” the game there’s no GUI on screen whats so ever :frowning:

I tried changing toolbar to simple buttons as well as playing around with the positions and still the GUI’s only show up when running scene directly through editor but NOT when I build and run the game on website or Windows standalone…

Please help! This is getting really annoying.

Do you have a small project to check?

looks like what you are doing is ok :s

hmm I don’t think I have…
And It started to appear now, but it ONLY appears near on one of my other gui buttons and I can’t change the position. I mean I can but it doesn’t change what ever I do… The gui toolbar stays on one of my gui buttons i have in game :S

if you take out the style, does it show when you compile it?

Nope it’s same thing…
I tried creating a new project and trying to add GUIs there, button showed up but stuff like toolbar etc doesn’t :frowning: And the codes are good because I copy/ pasted them from Unity3d documentation :S

Ok

are you sure the position of the elements are not outside the screen?

try to position all the elements in Screen.width/2,Screen.heith/2

even if they overlap, its just for checking them that they are there :slight_smile:

let me know how it goes :slight_smile:

nope still nothing.

Now the weird thing is, when i try to create a new project and add a button, it works.
Then lets say i want to add toolbar instead of that button.
I add everything nicely and instead of toolbar the same button appears.
There are no errors, everything compiles well but…

weird stuff :smile:

mhmm… can you make a small project that reassembles the problem so we can check it?

I have come across the same problem, I followed this tutorial: http://www.unitylabs.net/tutorials/user-interfaces/game-start-screen

in order to learn the basics of GUI in Unity, when I test in the Game Window in the editor it works perfectly. But when I came around to Building the *.exe it just showed the background image.’
I have tried to remove the background image to see if the buttons were behind it, but the buttons still were nowhere to see.

Further more after trying to fix the problem in several different ways an Error started popping up whenever I build; apparently I need a file called: c33035392c2802948bc7fc21130026cb.dll

But my none of the other computers my team uses have that file so I figure it has never been there in the first place, at least it only pops up when I build the specific project so the error must be somewhere inside that project.

Started over in a new Project now it works fine, doesn’t make sense to me :stuck_out_tongue:

Please can you report this as a bug. I think we already know about this, but an extra example might be useful in reproducing the problem.

I am having the same problem here. GUI works fine in Editor, but somehow it was gone after Build and Run. No matter you deploy as Web content or Executable standalone. Could be a bug.

Hate to revive old threads, but this just started happening to me, too.

I’m using Unity 3.0.0. I have a Pro and iOS Basic license. No builds have any GUI in them.

check the editor log after building and see if the script was even included etc.

Scripts are attached and everything. I’ve been fiddling with it for the past few hours, and there seems to be a disconnect between what the Editor calls iPad Wide (1024 x 768) and what actually is displayed on my iPad. For example, if I raise my buttons by a few hundred pixels, they show up on the iPad, but not the editor – visa-versa

I’ll file a bug report soon – I guess I’m the odd ball here?

I get most of my GUI but the textfields are not showing up when published.

If I create a simple script using the example from
http://unity3d.com/support/documentation/ScriptReference/GUI.TextField.html

It works when I run the game in preview mode. But once published it doesn’t show up???

Ok Problem solved for me. I just had to update to unity 3.0 and that seem to fix the textfield issue.

Another thing just to keep in mind, is if you are publishing for the web, The gui wont show up if the coordinates are for free aspect. i spent 2 days trying to figure out were my GUI went, and i found out the coordinates were for free aspect, off the screen.

I am experiencing a similarish bug, where

-The GUI works perfectly on older builds of my project that I built and run a week ago
-The GUI works perfectly fine in the editor when I hit the play button
-When I build the game for standalone deployment as a Windows executable, something interesting happens. The GUI doesn’t clean itself up when it changes. So I get graphical artifacts of the GUI objects from before, that just build up and never go away.