PUN 2 and Unity Addressables?

Hello guys,

I am trying to use addressables to add new weapons and items from a remote AWS after the game is launched, to my multiplayer game using PUN 2 but since PhotonNetwork.Instantiate method uses the resources folder to load gameobjects from, and this folder doesn’t let you mark gameobjects as addressables, I haven’t being able to find any documentation or online material addressing this issue… Does anyone here knows how to use PUN 2 with addressables? or where to find documentation/guides/ or tutorials about this subject?

Regards,
Carlos

1 Like

In PUN 2, the pool used by Instantiate can be replaced. As long as the pool knows how to identify and load the instances, you are not locked to the resources folder.
We did not experiment a lot with the addressables but it’s possible to use them. The only tricky part would be that our network Instantiate does not allow async loading, at the moment. So you need to load the assets earlier or you instantiate some impostor object, which gets instantiated instead and replaced as soon as the correct one is loaded.

Have a look at the IPunPrefabPool and how it’s used. Assing via PhotonNetwork.PrefabPool.

1 Like

I also encountered this problem. When I create a simple object and control it through PUN, PhotonView will lose ViewID

We need a repro. Prepare a minimal project with what you do, describe it and mail us the download link: developer@photonengine.com. We need to understand the situation to work on it.

Thank you I have sent a demo

Just got the ticket assigned. It may take a bit, as I am on vacation until Monday. Maybe a colleague can have a look but overall, I guess it’s my topic.
Thanks for the sample. Will update you by mail.

I received your reply, which helped me a lot. You are a great team. I will consult you again if I encounter problems. Thank you very much.

Hello tobiass,

It would be very helpful if you would post updates here since it will help everyone who has the same sort of problem.

Regards,
Carlos

2 Likes