DefaultPool fails to load my prefab once or twice then it works

I updated to Unity 2020 from 19 because of an error that wouldn't let me open my project. I also removed all of the appdata to try and fix the problem. Since then, I have many issues but the most concerning one is that when I open the project and press play it fails to load my prefabs that are located in the root of a resources folder (that was working perfectly before). I try again and it fails again. Then usually around the 3rd time of trying it works perfectly fine.

How do I fix this?

Comments

  • Zakf1
    Zakf1
    edited September 2020
    DefaultPool failed to load "Player". Make sure it's in a "Resources" folder. Or use a custom IPunPrefabPool.
    
    PhotonNetwork.Instantiate("Player", new Vector3(0.0f,0.0f,0.0f), rotation, 0);
    
    unknown.png

    I can confirm i get this error from time to time as well. Normally fixes its self after pressing play a few times.

    But this time im stuck in this state. Not sure what to do :(
    Also running Unity 2020.1.3f1 (i started in 2020 so did not migrate, but still get error)

    [UPDATE]
    I Shelved my latest, reverted back to last stable, and then unshelved. Nothing changed, but error went away.
  • I am also having this issue as well. I can confirm my Player prefab is in a Resources folder but it is under a custom folder structure (not the main Resources folder). The error happened only AFTER the upgrade to Unity 2020 and update to the September version of PUN.
  • Status Update: I found a code implementation workaround/fix and implemented it... it works in my solution so far... player prefab is loaded. Solution here: https://forum.photonengine.com/discussion/16037/non-resource-located-network-prefabs
  • @KathleenWest Thanks for posting that solution, I'm seeing the same error here ( new project, Unity 2020.1.5f ).

    With the code to register the prefab, it works every time!
  • I just changed the name of my Prefab and I changed the string used to Instantiate the prefab.
  • infogamerhub
    edited November 2020
    Here is a video on how to fix this

    https://youtu.be/oF7_qcXoZ_E
  • Hi everyone, Trying reimport the prefab also work.
  • preshu wrote: »
    Hi everyone, Trying reimport the prefab also work.

    That worked thanks
  • TantX
    TantX
    edited August 2021
    I just changed the name of my Prefab and I changed the string used to Instantiate the prefab.

    This problem stuck me whole night...
    I also got problem like you, after renamed my prefab, it happend

    re-import prefab is not worked for me TOT

    Then I read some posts like KathleenWest shared above
    I found there are Resource cache exist, it seems like the problem is casued by cache not be cleared in some reason

    so, when I put these in my code before where I call "PhotonNetwork.Instantiate"
    it works (YEAH~!) :
    DefaultPool newDefaultPool = new DefaultPool();
    		newDefaultPool.ResourceCache.Clear();
    		PhotonNetwork.PrefabPool = newDefaultPool;
    


    ( after let it run once time, you can remove it, because it has already cleared the cache for you )