Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug CCD doesn't load and use scripts

Discussion in 'Unity Cloud Content Delivery' started by zumwalt, Apr 25, 2022.

  1. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    I finally got Loady Dungeons demo to work in the editor so that it downloads the content from the bucket, and plays within Unity Editor, but when you build the game, then try to run the exe, it loads up the first level correctly but the mouse for the player movement script does not work, the player script is not loaded. So, how do you make CCD load scripts that are attached to the bundled assets? In this case the Dino has a player script, only the Dino asset is loaded with no script in a build, but it does work in the editor without a build.

    I want to use CCD with my current game I have deployed everywhere except android on the google store and I need to make a package that will work with CCD, but I have scripts on all of my non static assets and from just seeing Loady Dungeons fail, I am afraid that none of my scripts will load either, so sticking with the loady dungeons demo until I can get a reason why after a build, the assets stream but zero scripts stay attached to objects.
     
  2. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    CCD doesn't cache and use the local cache first or check for hash difference, so it is always getting the content downloaded, which is not good since I want the CCD to be smart enough to know level 00 is already downloaded and use the local copy if the hash is the same as the hash of the file in the CCD bucket. What workaround is there for this? My levels for my published game are between 500MB to 750MB per level so I clearly do not want players re-downloading on every load of the game, should only download if there is a delta difference. But again, attached scripts to objects don't seem to work.
     
  3. Unity_JonathanCl

    Unity_JonathanCl

    Unity Technologies

    Joined:
    Feb 24, 2022
    Posts:
    15
    Hi @zumwait,
    If you use CCD with the AssetBundle, it will only work for non-code assets that Unity can load at run time.
    As an alternative, you can maybe combine cloud code and remote config with CCD.

    For the question regarding caching, can you make sure that the "Use Asset Bundle Cache" is checked in the Advanced Options?

    • Go to Window -> Asset Management -> Addressable -> Groups
    • Click on "level 00"
    • Click on the inspector tab

    upload_2022-4-26_16-9-0.png

    Best,
    JC
     
  4. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Hi Jonathan.
    Do you mean that CCD can only be used for prefabs and sprites?
    Do I have understood that we cannot download, for instance, a scene with addressables from ccd?
    Thanks.
     
  5. ryan_ngo

    ryan_ngo

    Unity Technologies

    Joined:
    Feb 2, 2021
    Posts:
    35
    Hi! you are able to download scenes via Addressables and CCD. It's more that if you're going about this route, things should built into AssetBundles and uploaded to CCD. This will allow Unity to more easily load and use the assets within Unity.
     
  6. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Thanks Ryan