- Home /
Games built in Unity run slowly
Hello! I don't know why, but when I build my game in Unity and run the .exe file, it starts really slowly. Inside Unity it runs normally, but the executable not. My project isn't big and I also tried it out with another projects and on another computers, but it's extremely slow.
E.g.: In one of my projects the first scene is a menu with four buttons and when I click on one of them it loads the new scene, but only after a bit freezing, what's around half a minute long.
I know it's strange but I can't do anything with it...
Can anybody help me what do I do wrong?
EDIT: Here is a setup file for my game
Did you try reinstalling Unity? Is this happening with empty projects aswell? Do you have all scenes in your build? Have you tried removing unused assets?
Check the Player logfile of your built game. Perhaps you see some kind of error being spammed.
Answer by Griautis · Oct 16, 2014 at 11:23 AM
Hey, if it runs properly in editor, it should run the same way when built. If that's not the case, please report this as a bug and of course, try to look for a workaround, so you might continue without waiting for the fix.
I'm not sure it's as simple as that. Inside your build you could change to use DirecttX11 / 9, or 32/64 bit, etc. Any of these build options could effect performance.
Could we see the code for your 4 buttons and menu? Could be as simple as too many If statements acting against each other.
Sorry, but it's in Hungarian... And there are only three buttons and one picture.
#pragma strict
var Stilus : GUISkin; //Az Inspectorban szerkeszthető stílus
var Hajtovadaszat : Texture;
var $$anonymous$$agassag : int = 250; //A script által növelt változó, mely az elem helyzetét határozza meg
var GombSzelesseg : int = 150; //A gombok szélessége
var Gomb$$anonymous$$agassag : int = 50; //A gombok magassága
var $$anonymous$$oz : int = 30; //$$anonymous$$ét gomb közötti hely nagysága
private var Eloszor : boolean = true; //Azt tárolja, hogy a script először van-e meghívva
private var Pozicio : int = Gomb$$anonymous$$agassag + $$anonymous$$oz;
function OnGUI () {
GUI.skin = Stilus;
GUILayout.BeginArea(Rect(0, Screen.height/2-300, Screen.width, 800));
GUILayout.BeginArea(Rect((Screen.width/2)-(Hajtovadaszat.width/2), 50, Hajtovadaszat.width, Hajtovadaszat.height));
GUILayout.BeginArea(Rect(0, 0, Hajtovadaszat.width, Hajtovadaszat.height), Hajtovadaszat);
GUILayout.EndArea();
GUILayout.EndArea();
if (GUI.Button (Rect (Screen.width/2-GombSzelesseg/2, $$anonymous$$agassag, GombSzelesseg, Gomb$$anonymous$$agassag), "Játék indítása")) {
Application.LoadLevel("Terkep");
}
if (GUI.Button (Rect (Screen.width/2-GombSzelesseg/2, $$anonymous$$agassag + Gomb$$anonymous$$agassag + $$anonymous$$oz, GombSzelesseg, Gomb$$anonymous$$agassag), "Instrukciók")) {
Application.LoadLevel("Instrukciok");
}
if (GUI.Button (Rect (Screen.width/2-GombSzelesseg/2, $$anonymous$$agassag + 2*(Gomb$$anonymous$$agassag + $$anonymous$$oz), GombSzelesseg, Gomb$$anonymous$$agassag), "$$anonymous$$ilépés")) {
Application.Quit();
}
GUILayout.EndArea();
}
Ehh I can't read Hungarian. I see the normal stuff, but I don't know what half the stuff is in English lol. And I'm not familiar with to much with Unityscript anymore.
Sorry I can't help much, but maybe somebody who can atleast piece together what the other language means and find an error in it.
Try doing a test and see if it runs slow.
Start a new scene and just put a plane with a box on top of it (of course with a camera looking at it)
See what the Frames are.
It also could be Vsync. Goto Edit > Project Settings > Quality and change the Vsync to None or off or whatever it is. (Ur frames will be way better than always) and it may or may not work better for the situation of your game as it can cause screen $$anonymous$$ring.
I put a link for a setup file of my game, so you can have a look on it and how does it run. The first run is extremely slow, it's around a $$anonymous$$ute to start the game (the first button in the menu)...
Answer by sevginurbilgin · Mar 21, 2018 at 10:53 AM
I have the same problem, Could you find any solutions???
Your answer
![](https://koobas.hobune.stream/wayback/20220613165207im_/https://answers.unity.com/themes/thub/images/avi.jpg)