- Home /
Build altering strings.
Hey everyone,
I'm running into a strange problem where all the strings have their spaces removed when I build the game into an executable for windows or .unity3d for browsers. For example a string with the characters "This is a String" turns into "ThisisaString". Is there something important I missed in a tutorial somewhere?
As statement says, does the font you use actually have a space character defined? Or maybe the space is extremely narrow. If you print hello(100 spaces)world do you get hello and world separated by some space?
Yes I'm using custom skins and never even thought that would be the problem. When I run the game in the editor it works fine but when I build it and run it on a different computer that's when it messes everything up. I'll poke around and see if the spacing is the problem.
I found all the options in the GUIskin. It says it's a script but I can't open it to look at it. I can only change value in the editor. What would an option for character spacing be called and why is the value changing during build but everything else remaining the same?
Answer by Joshua · May 23, 2011 at 03:20 PM
I would definitely need additional information to be able to help you. Spaces should definitely appear in strings. For instance
function OnGUI () { GUILayout.Label ( "Hello World"); }
Should put Hello(space)World on the top left corner of your screen. Could you check if that at least works to make sure it's something odd you did inside you script?
Building seems to affect all strings that end up on the GUI. Here's one of my GUI.Labels
GUI.Label(Rect(welpos.x,welpos.y,welsize.x,welsize.y),"" + welmes);
where welmes is a welcome message.