Any idea what’s going on here? Everything should be working

Options

I’m trying to download a scene as an assetbundle. I’m confused because it works sometimes and then decides not to work other times. I’m not really sure what’s wrong but hopefully you can help me… thanks

Best Answer

  • Tobias
    Tobias admin
    Answer ✓
    Options

    You must first download the assetbundle, then join the room.

    Hmmm, yes, that sounds reasonable. PUN expects being able to immediately load the scene.

    Glad you found that.

    If you downloaded a scene that's not used then, cache it. Use it next time.

Answers

  • Klover
    Klover ✭✭
    edited August 2022
    Options

    still haven't found a fix

  • Klover
    Options

    ok ok I THINK the problem was I was trying to use PhotonNetwork.AutomaticallySyncScene = true; while downloading scenes as assetbundles. You can't sync the scene until the assetbundle is downloaded so I was getting an error because it tried to sync it before it was even in the game.

  • Tobias
    Options

    So it's working now?

    I don't know if PUN's automatic scene sync is suitable for Addressables but you might make it work. Did you change PUN code?

  • Klover
    Klover ✭✭
    edited August 2022
    Options

    @Tobias I didn't change any PUN code, but yes it is working now.


    PhotonNetwork.AutomaticallySyncScene = true; has conflicts with assetbundle scenes if the asset bundle is being downloaded from the internet. PUN was attempting to load a scene that wasn't even in the game yet.


    It happens when you join a room first, without downloading the assetbundle.


    You must first download the assetbundle, then join the room.


    The reason I didn't initially do it this way is because what if the room was closed already and you just downloaded the assetbundle for no reason? But it's whatever :/

  • Tobias
    Tobias admin
    Answer ✓
    Options

    You must first download the assetbundle, then join the room.

    Hmmm, yes, that sounds reasonable. PUN expects being able to immediately load the scene.

    Glad you found that.

    If you downloaded a scene that's not used then, cache it. Use it next time.