I’m making a racing game, and throughout the game you can upgrade skills which effect speed, turning and other various things. When playing the game in the editor everything works great and building the project seems to be no problem. But, when I start playing, none of the skills work. I’ve debugged some of the skills out and they are returning the right values, but I just don’t understand whats going on with it. I haven’t posted my code or anything in here, but if anyone needs it, just let me know and I can post it.
I think you need to post a specific question if you want some help. You’ve really only given us some information about your game and then said “it doesn’t work”.
I can give you an equally general answer if you like: “Debug more.”
Now for a useful tip… Try a technique known as “divide-and-conquer”. Remove as much as possible from the situation, then debug a piece at a time. If you strip everything out but the basics, and it works, then add stuff back in slowly until it breaks. That is the easiest way to find a bug. Use lots of Debug.Log() messages.
Finally, clean up code. This may sound funny, but honestly I can’t even count the number of times I have fixed a problem by simply making code look nicer. Doing some house keeping is a great way to find those missing keys without actually looking for them
Anyway, after doing some divide-and-conquer, if you have some broken code and aren’t sure what’s going on, that is a great time to post.
Can’t say it better but if your game have lots of scene. Try building one scene. Put in some bogus values so that you can try out that scene and do things like buy things upgrade (after you changed the values).
Hey guys, thanks for your answers. I figured out the problem, it seemed to be the script execution order. I’m sorry about the general question, I didn’t really know what to ask for because I was thinking that the code must work because it works while it’s in the editor.