- Home /
Game not working after build!
Hi, am new to unity. I tried out my first ever game. It is working very fine withing the Unity engine but once i completed the built (PC and Mac standalone) and tried playing with the exe file, most of the features aren't working! like, throwing an object or other gui textures i used are not working. But they are still fine in unity with no errors. Where did I go wrong?
I have been pouring through searches and this forum trying to find an answer to the same type of problem you are experiencing. I have my game operating without errors in Unity (before in 3.5 & now upgraded to 4.0) yet when I build the Windows version and play the game I get no errors but some functionality doesnt work.
Example, when I defeat an Ant it is supposed to play a Death animation yet it doesnt (all other animations work perfectly). $$anonymous$$y HP regeneration routine doesnt kick in either..so weird..
i supposed its a bug.. or it could be your scripting problem..
sometimes your script has no errors, but your structure or coding is wrong. - the script is correct but how you make it function might cause the problem.
try this for your character regen... im not sure how's the script looks like but here's my point of view..
create other script for your regen..
like..
var time : int or float;
function Update(){
time = Time.deltaTime; time ++;
if (time ++){
[player].[newScript(Health)] = ++
}
}
something like that...
Answer by bazzer · Nov 28, 2012 at 10:43 AM
Check the file called "output_log.txt" which is located in the YourGameName_Data folder after you have run Build. I had a similar problem (see above) and found the answer contained in the output_log.txt.
Once I read about the problem in the log I was able to modify my code and re-build and had no more strange behavior or missing functionality.
I wish I can upvote this answer. The log details out the error I am having and once I fixed it, the game works!
This is very helpful - after about an hour of building, checking the output log, and making adjustments to the project's structure ($$anonymous$$or changes), I was able to fix the very elusive (and inconsistent) errors that I was facing after building to different devices.
To anyone that is developing a multi-platform game, please note that each platform processes your code and scenes a little differently. For example:
I had a problem where an NPC would not show up and walk around when triggered (Nav$$anonymous$$eshAgent). This only happened on Android and $$anonymous$$ac build - the Windows builds had no problem with it.
After searching the output log for potential errors, I realized that the project was using one Nav$$anonymous$$esh for two different versions of the same level. Strangely, this provided no errors while in the editor (along with the unaffected builds).
The fix for that part required me to create two separate Nav$$anonymous$$eshes for the corresponding scene. Hope this helps others who are experiencing similar issues to my own.
I don't see an "output_log.txt" if I don't see this does it mean I did something else wrong
make a dev build and within the game window when running, there should be a button that says show dev log or output log..
For anyone that is looking to find the log nowadays (see comment date), you will be looking for a file called "Player.log" now. There is also a file called "Player-prev.log" (which stores information about your session before last) and they are both located in your AppData folder.
Specific Location - C:/Users/Username/AppData/LocalLow/CompanyName/GameName
Hope this helps!
Where to find the "output_log.txt" file, I can't find any of it in my game folder or game project
Answer by Maulik2208 · Nov 28, 2012 at 09:26 AM
try this link----------->>>> link text
And Hope Your problem will be solved by this.....
well.. this is the closest solution to the problem..
good job bro..
Answer by vatsannatarajan · Nov 02, 2012 at 01:01 PM
Yes I did. It is still working fine in Unity. I did the sample project from Unity- Survival Island game. There is a part where the player throws coconut. It works in Unity but not in the executed file.
	void Update () {
	if(Input.GetButtonDown("Fire1") && (canThrow)){
			audio.PlayOneShot(throwSound);
		 Rigidbody newCoconut = Instantiate(coconutPrefab, transform.position,
				transform.rotation) as Rigidbody;
			 newCoconut.name = "coconut";			
			newCoconut.velocity = transform.forward * throwSpeed;
			Physics.IgnoreCollision(transform.root.collider,
			newCoconut.collider, true);
		}
	}
This is the code i used. Thank you :)
so you are saying that the game works in Unity and NOT working when its built??
so when you start you game, it initially starts and then it crashes. Did that happen??
btw, your script seems fine, thats all i can say..
Answer by vatsannatarajan · Nov 05, 2012 at 08:37 AM
Yes. It works in Unity. And i'm able to open and play the built game, it doesn't crash, but few features aren't working. like in the above script the player must throw a coconut, but the player stays idle in the built game.
there are few possibilities that i could think of..
it could be your controller settings why your character is at idle.
it could be your computer's performance that is causing this. Though its playable in Unity, its uncertain if you can play in the exe file. Depending on your PC's performance that is. Try upgrading the RA$$anonymous$$ and the Graphic Card. Reason : The materials might be too heavy for your PC to handle. But in UNITY it looks nice - its because most of the RA$$anonymous$$ usage went into UNITY.
Upgrade UNITY.
its possible though, but im not so sure what's causing it to crash and what not.
Answer by Adam8500 · Jun 21, 2018 at 05:00 AM
Had the same problem kavanavaks answer fixed it. Did a dev build and windows defender asked permission to allow certain functions. Allowed it one time and no problems.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Coroutines are executed faster in Build 1 Answer
Command-line build 64-bit 1 Answer
framework not found FBLPromises after build in XCODE...ERROR 1 Answer