ObjectPooling Probelm, maybe a different approach ?

Options
S_Oliver
S_Oliver ✭✭✭
Hello there,
I wanna use ObjectPooling for reusing GameObjects.
So i made this https://pastebin.com/uZSWg8Jx.
And Unity give me this Error :

The Problem part is from line 54 to 73.

Its like Instantiate a GameObject with a PhotonView, looking for the GameObject with the viewID but dont find the GameObject, but the viewID is there.

@jeanfabre @JohnTube
any Idea ?

Comments

  • S_Oliver
    Options
    Ok, i made some changes
      private Dictionary<Transform, Stack<GameObject>> pools = new Dictionary<Transform, Stack<GameObject>>();
    to
      private Dictionary<int, Stack<GameObject>> pools = new Dictionary<int, Stack<GameObject>>();
    Creating uniqe ID for every pool works fine, now the Hierarchy is a bit messedUp but thats Ok for now.