Can anyone explain why this Rigidbody View cannot find the PhotonView directly above it?
Not sure if there’s anything else to explain.
Thanks
Can anyone explain why this Rigidbody View cannot find the PhotonView directly above it?
Not sure if there’s anything else to explain.
Thanks
Hmmm. The Rigidbody View is in the list of observed components but still shows the warning?
Odd.
How can we reproduce this? I tried to repro but can’t.
Which Unity version is this? Did you already update to PUN 2.21 (would recommend that for the fixes).
I am using Unity 2019.3.10f1 and PUN2 2.20.
It’s now happening to both cars
Not sure if there is anything important to do to reproduce it. All I did was create a basic GO with what’s above and networked them mainly using the tutorials on your website.
:S
That is your own PunBasics tutorial folder…
My Robot Kyle -done-
If you use PUN 2.20, you should definitely update. There is no big change in 2.21 but we fixed a few glitches meanwhile.
Maybe this was fixed since? I can not repro this (in v2.21), even though I happen to have 2019.3.10, too.
Can you guide me how to upgrade it? Do I delete the folder and then re upload it?
It’s quite easy, as there are not breaking changes.
Open the Asset Store panel in the Editor, find “My Assets” and “PUN 2” in that list. There should be an “Upgrade” button. Once that’s done, click “Import” and a window will open to get the latest files. The button to actually import is at the bottom right.
I updated PUN but still happens. Not sure what to do now. I’ll try and do some more testing but given the warning I think maybe it’s not something I have done. I don’t know
Finally found an error. Get this…
on this code…
case PunEvent.OwnershipUpdate:
{
int[] viewOwnerPair = (int[])photonEvent.CustomData;
for (int i = 0, cnt = viewOwnerPair.Length; i < cnt; i++)
{
int viewId = viewOwnerPair[i];
i++;
int newOwnerId = viewOwnerPair[i];
PhotonView view = GetPhotonView(viewId);
Player prevOwner = view.Owner; //THIS LINE ERRORS
Player newOwner = CurrentRoom.GetPlayer(newOwnerId);
view.SetOwnerInternal(newOwner, newOwnerId);
// If this produces an owner change locally, fire the OnOwnershipTransfered callbacks
if (PhotonNetwork.OnOwnershipTransferedEv != null && newOwner != prevOwner)
{
PhotonNetwork.OnOwnershipTransferedEv(view, prevOwner);
}
}
break;
}
}
In classic fashion I have found the rookie error I have made unrelated to PUN. The warning concerned me and threw me off a little.
Thanks for the help
Thanks for the update. Glad you could find it!