Search Unity

Build problem: Always old version is build

Discussion in 'Editor & General Support' started by phensch, Jan 16, 2010.

  1. phensch

    phensch

    Joined:
    Oct 13, 2008
    Posts:
    23
    Hi.

    I have a strange problem with my Unity free version. When building the game scene the engine uses always old scripts. When runnig the game in the editor it works fine with new scripts and all features of them.
    Also "build and run" produces the old version (I don't understand where the engine gets the old scripts from).

    Is there a backup from where the engine gets its building information that I can clean?

    Has anyone a hint what I could do?

    Thx for help!
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    sounds more like it can't overwrite the build folder.

    but to be sure just delete the target player folder and remote the temp folder. both while unity is not running
     
  3. phensch

    phensch

    Joined:
    Oct 13, 2008
    Posts:
    23
    I build the scene always to a new folder, so there should be no access problems.

    Where is this temp folder you mentioned?

    Strange thing is: when I make changes to the scene, all changes are also in the build version. Only the scripts seem to be old.
     
  4. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Posts:
    2,058
    Is it possible that you have a script that isn't compiling? Are there any error messages in the console?
     
  5. phensch

    phensch

    Joined:
    Oct 13, 2008
    Posts:
    23
    All scripts are compiling. I can play the game with the newest scripts in the editor (so, they are really compiling ;) ). It's only the build that is not taking the scripts.
     
  6. dimaantonov

    dimaantonov

    Joined:
    Jan 15, 2010
    Posts:
    27
    Same problem here. I understand there's some kind of cache for builds, because build compiles long first time and then times faster. What to delete?
     
  7. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Posts:
    2,058
    If you look at your project folder, there is a Library/Cache folder that seems to contain scripts. I've never had reason to delete it however. Make sure you back things up!

    The compiled scripts are contained in Project/Library/Assembly - UnityScript.dll. This is updated as soon as a script is compiled. Try checking the timestamp on this file, see if it refreshed as you make changes. Compare it with the one in a final standalone build.
     
  8. dimaantonov

    dimaantonov

    Joined:
    Jan 15, 2010
    Posts:
    27
    Somehow I managed to solved it, but not sure what was it exactly. I'll tell what I did.

    I'm also glad to have Cthulhu fan helping me :) I'm awaiting 'the right stars' too.

    Okay, so cache folder better not be touched, it kills lots of stuff in the scene (especially Terrain object).

    It looked like Assembly - UnityScript.dll was a bit old. I tried moving it out of project and making a build, but it didn't help. Then I located windows standanlone build and deleted it with all the folders. Then decided to reboot (I wasn't rebooting my PC for about a week, always put it to sleep instead). So I rebooted.

    After that I tried playing a game in Unity and console said that scripts were not found. Hmm. I decided to move script folder of the folder where it was and than put back again. Console kept quiet after this. And builds look okay.
     
  9. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Posts:
    2,058
    So you are saying the resolution was simply the old adage, "When in doubt, reboot?" That's just lol! Us mac users are lucky enough not to have those headaches.
     
  10. dimaantonov

    dimaantonov

    Joined:
    Jan 15, 2010
    Posts:
    27
    Well, just like I said, I'm not sure what exactly helped. But something out of the actions I listed in previous reply. So it's a bit early to blame PC with need to reboot.

    Maybe the guy who created this thread can lit light on this, I even sent a PM to him.
     
  11. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Posts:
    2,058
    If you can reproduce it reliably I would certainly file a bug report. It's not a situation I've ever encountered on osX beyond a compilation error.

    Do you perhaps have a backup copy of the project that still exhibits the errant behavior?
     
  12. dimaantonov

    dimaantonov

    Joined:
    Jan 15, 2010
    Posts:
    27
    Nope, doesn't reproduce. I'll adding changes to the project in the next days. If it happen again, I'll write about it here.
     
  13. phensch

    phensch

    Joined:
    Oct 13, 2008
    Posts:
    23
    Well... very strage, I fixed it, though I don't exactly know what the problem was.

    I deleted the previous build, then started unity and build the scene anew. Then it worked. :eek:

    Seems that the windows unity does not like it when it finds a previously build version in a target folder.

    So, workflow seems to be:
    - complete your current version
    - exit unity
    - delete all previously build versions in the target folder
    - start unity and build your game
    - cross fingers that this solves the problem ^^

    If someone could acklowdge this it would be good.
     
  14. dimaantonov

    dimaantonov

    Joined:
    Jan 15, 2010
    Posts:
    27
    Fantastic! Thank you very much for sharing this.
     
  15. S3gaSonic

    S3gaSonic

    Joined:
    Feb 2, 2013
    Posts:
    1
    I have figured out why I was having this same problem. Under the build settings window, the scene that was being built was the wrong scene, I add to re-add the current one and unselect the previous one. Dunno if that helps anyone but, thats what my problem was. =]
     
    deLord likes this.
  16. unity_TtSKlu4jQLkuGQ

    unity_TtSKlu4jQLkuGQ

    Joined:
    Nov 25, 2019
    Posts:
    2
    I have a simmilar problem, but I think it is because I dont have any Assembly-UnityScript.dll at all! How can I see its date if it doesnt exist?
     
  17. LeeLorenzSr

    LeeLorenzSr

    Joined:
    May 3, 2015
    Posts:
    50
    I've been banging my head against the brick wall on this problem.... I have just realized what the issue is, for me at least. This is the first time I've done a release build for my game, Astrokicker, on my new system, to upload to Steam. I forgot that I need to copy the contents of the PC_Build folder to the Steam game folder before testing the built binaries.

    If you are having this particular issue with a game you have released on Steam (possibly other platforms), be aware that launching the player will call up the binaries in your Steam game folder, not PC_Build. I know it's strange. It was driving me crazy, as I put the build timestamp, and the current version in my title screen, and kept seeing the one from the old build. Ugh.
     
  18. albertlouzon

    albertlouzon

    Joined:
    Oct 7, 2021
    Posts:
    1
    Its insane ... My prefab behaves like the version I had a week ago. Cleared cache, removed build files etc... Each time I build the problem comes again
     
  19. BobbyDoogle

    BobbyDoogle

    Joined:
    Dec 3, 2013
    Posts:
    17
    I'm seeing this too, I set settings on a prefab I see them, but when I play the game its just not the settings from that scene, its like an old version, oddly, its not on everything from the scene, but definitely those settings on the prefab.