Duplicate Photon View

steelax500

New member
Hi, I am new to this Asset but have been working through the Tutorial Videos. After learning how to create a character and Item and Shoot etc, i decided to try the PUN Addon, i followed the tutorials thoroughly and other than the fact i had no ingame items to interact with or pickup i didnt deviate from the videos.

The issue i am facing is when i run the game twice i am getting the following error (followed my much much more errors)

PhotonView ID duplicate found: 1. New: View 1 on Character(Clone) (scene) old: View 1 on Character(Clone) (scene). Maybe one wasn't destroyed on scene load?! Check for 'DontDestroyOnLoad'. Destroying old entry, adding new.
UnityEngine.Debug:LogError (object)

I have looked through the forums and no one seems to be having this issue. Any help would be amazing

Cheers Stephen
 
I haven't seen that error before. Are you running the latest version of PUN and the add-on? Are you able to reproduce it within the demo scene?
 
So i tested the Demo and that is working so im clearly just missing something, i will look over the demo logic vs mine and see what i have missed, Thanks for pointing me to it.
 
I got this when I upgraded from UTPM to TPC.
All the characters that I made with UTPM are fine, but now all the characters I make with TPC get this PhotonView error like it's clashing with assigning PhotonViews in realtime vs the Opsive setup which automatically assigns IDs to objects with colliders.
1615661303836.png


Just as a note, Sword04 was created with UTPM and works fine for the other 30 characters I have.
 
Last edited:
Is there something internal that is assigning the PhotonView IDs?
As subsequently ID 1 is being assigned twice, and now ID 2.

These are both new characters having since upgraded from Photon and from UTPM, to TPC.

The old characters can still have newly created and old runtime weapons that work fine with no errors. However new characters get errors with at least 1 random pickup that shares the same PhotonView ID at runtime.
 
Last edited:
A quick fix I found was the following:
1615664707851.png

Setting the PhotonVIew ID to something fairly high up.
 
Last edited:
@BJPickles I have the same problem. Do you use old PUN? At PUN2 you cannot change View ID. I Instantiate several AI characters. I get that duplicate error for half of them.
 
I think I found the solution;

Select your prefab from Project tab
Right click the Photon View component on that prefab
Modified Component/Revert

That solved my problem. Prefab gets a view id and always uses that id. when you reset prefabs component, photon gets new view id.

I hope that helps.
 
Top