Ownership transfer stopped working

I've been looking through similar posts, but haven't found a good solution to the problem I am having, so I decided to post this.

I recently started making an online game where players bring items from around the map to their own scoring zone to see who has the most in the end. The most important mechanic; "picking an item up and dropping it" has suddenly stopped working (perhaps) ever since I started getting the message; "Recieved OnSerialization for view ID ????. We have no such PhotonView!"

The problem occurs when I try to pick an item up from the client side. It syncs when the master picks it up, but does not when the client does. I have been using the transfer ownership function and it worked fine, the Debug log showed the transfer and it updated on master's side. However, a few days ago it stopped doing just that. I was able to get the debug log to show the transfer again, but it will not update on master's side.

The code I use for the transfer (simplified):

if (heldObject.GetComponent<PhotonView>().AmOwner)
{
hold();
}
else
{
heldObject.GetComponent<PhotonView>().TransferOwnership(PV(photonview on this object).ViewID);
hold();
}

The above code (should) check if you are the owner, and if you aren't, transfer ownership to self. However, every time I pick an object up, the owner is not changed, so it executes the code in "else".

As I stated before, this problem never occurred before and transferring ownership worked just fine. My Players' view IDs tend to be in the 1000s (which is not possible since IDs can only be up to 999?).

I am really confused since this worked before and only now did it stop working.

Any help is appreciated.

Comments

  • Your heldObject PhotonView, Where it says owner, and there's that dropdown box. Make sure it's set to "Takeover".

    Also, are you getting anything in your log? Photon will generate a Debug.Log when something a transfer of ownership takes place.
  • James_MF wrote: »
    Your heldObject PhotonView, Where it says owner, and there's that dropdown box. Make sure it's set to "Takeover".

    Yes, all items are set to takeover.

    The debug log says ownership has been transferred from (item's ID) to (player's ID), but when I pick the same item up, it outputs another Debug.Log saying the same exact thing. It shouldn't since I would be the owner after transfer right?
  • I highly recommend updating PUN 2 to the latest version v2.28, in case you are not using 2.27 at least. We refactored some of workflow to assign / take control, so this will affect this case directly.
    If you can't make it work after the update, clearly let us know how to repro the case.

    How many objects are there?
    A viewID of 100x is used by the player with actorNumber 1 (x1000). So each user can easily assign 999 viewIDs when creating objects.