- Home /
Help track down why some functionality is lost after building my game
I have been building a simple rpg game and learning about Unity and C# in the process. Things have been going well until I came across a weird problem that I have been unable to solve by myself.
The problem is that when I build my game for Windows platform some of the functionality is lost yet there are no errors given during the compile process.
Examples of lost functionality - Death animations wont work but all other animations work fine on my enemies. - My regen routine doesnt work at all but loss of health on hits etc works just fine...
Some background info: Started on Unity 3.5 and since upgraded to V4 to see if this fixed the problem. It didnt help, problem still remains. Tried on Win7 and now on Win8..same problem.
If I copy my whole project folder to another PC and play the build exe from within the project folder everything works fine...
If I make a Build of the Game in some other directory and copy just the build Folder to another PC the problem reoccurs.
This is driving me crazy as my children want to help test the game but every time i make some changes I have to copy the whole project folder to their PC and I have downloaded a bunch of assets into my project folder that I dont yet use in the game. The build version of the game comes in at 120 meg yet my project folder is around 2 gig (yes I hoard stuff I guess).
Any pointers would be greatly appreciated!
When you move the .exe around, do you move the data folder too? You probably do, but I want to be sure!
Yeah, I copied the folder that contained the exe file and the data sub-folder.
I am looking into names of scripts etc now to remove anything that might cause problems (like an underscore char) but the problem is still there...
Hmm, perhaps some light will be found in knowing the difference between your death animations, and your non death animations, as well as your death regen script. By any chance, are the death animations, and the death regen action, are they both being controlled form the same script? Furthermore, is your loss of health controlled form a SEPARATE script? Sounds like something is causing one specific script to go wrong
Answer by bazzer · Nov 28, 2012 at 09:03 AM
I found the problem. It seems there was a problem with my save game location. I was saving to a text file in my Resources folder and it appears that Unity only wants to Read from this folder (ReadOnly). I changed my save routine to use PlayerPrefs for now which is a temporary work-around until I find a better solution.
It explains why I was not receiving any errors during the build phase, as my SaveGame routine only kicked in when something changed after the game had started.
Something to note was the strange behaviour of my game. Some functions/methods worked from the Script that had the SaveGame function/method while others didnt (such as my regen).
Anyways, thanks for your help Flynn. Your mentioning about SEPERATE script got me looking for any other scripts that may have been involved and along the way I found a file in the Data folder called "output_log.txt". This file had the error about the SaveGave failing which allowed me to solve the problem.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
XBox One Build FileNotFoundException 0 Answers
Build argument -reference:ALIAS=DLL 2 Answers
Lambda + micro mscorlib 0 Answers
Possible to compile for iOS for my testing without license? 2 Answers