The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

NetworkInstantiate prefab with multiple Views

2020-09-09 17:12:23

Apologies if this is a dupe, I couldn't find anything similar:

I'm trying to instantiate a player prefab to which I recently added two additional children with PhotonViews, and its causing an exception (index out of range) in PhotonNetwork:NetworkInstantiate.

Problem is that if localInstantiate remains false, then parameters.viewIDs is not reassigned with the correct length from the photonViews array.

Does anyone know if I might have misconfigured something, or if this might be a bug?


2020-09-11 03:49:23

Nested photon views are not officially supported, because things like what you are trying to do there will break them. Nesting handling has been added recently - but it is not completely supported. To pull off instantiating like that, you will need to instantiate them individually, and then nest them manually currently.

I will look into making what you are trying to do possible in future releases.

Is there a reason you have nested PVs though? Usually when people do that, it is a bad practice which can be avoided.

One use case would be if an object fractures into parts later. If the object does not break apart into separate entities, a single root view usually is preferable.

2020-09-18 17:16:42

This is in my user avatar construct. I'm doing a mixed-reality app, so my avatar consists of a head transform and two hand transforms, each of which are being synced.

I actually overcame the problem I was having and now I can't remember how - the only thing I can think of at the moment is that I may not have set the two PhotonViews in the children as Fixed ownership at first.

Back to top