Change networkView owner not working

Hi,

I have a little multiplayer project, where you can run around and sit in helicopters and fly them. Because the server spawned the helicopters the networkView belongs to him. That’s not what I want. Because of this I’ve read those two posts: this and this. But I’m not able to get it to work.

When the player is in the trigger zone of a helicopter (door) and presses “e”, the player is positioned in the vehicle the meshrenderer is disabled and so on. After that I execute this:

NetworkViewID newID = Network.AllocateViewID();
triggerCollisionRoot.networkView.viewID = newID;
networkView.RPC("setHelicopterViewID", RPCMode.Others, newID);

Then in the helicopter script is this:

[RPC]
void setHelicopterViewID(NetworkViewID newID) {
	networkView.viewID = newID;
}

But this isn’t even getting called. I tested that with some print()'s.
Maybe I’m missing something fundamental?

Hi, try to call RPC function in player script before changing it’s own viewID. Another way, it will send RPC message to network views with new viewID.