Hello, I want to:
-
Check if Owner is me, if it’s not, then get it.
-
Save previous owners IDs (or something I will need later).
-
Do something with this objects.
-
When done, return objects to previous owners.
How can I do this? Especially, their IDs - how to get it and how to save?
if (!photonView.isMine)
{
Player previousOwner = photonView.Controller;
photonView.RequestOwnership();
…
DoSomething();
…
photonView.TransferOwnership(previousOwner);
}
else
DoSomething();
Something along those lines, most likely in a coroutine, I don’t remember if you have to wait for the ownership request to be processed to be able to do anything. You might have to implement IPunCallbacks.OnOwnershipRequest() depending on the object.