Network.destroy() fix?

So I looked at the new changelog and saw this.

Does this mean I can just…

Network.removeRPC(networkView);
Network.Destroy(gameObject);

…and this will now make sure this object gets destroyed over network and isn’t created when new players join? It would really be nice to get rid of my silly hack.

This is from my phone so sorry for the formatting.

Seems to work.

it’s removeRPC(networkView)?

Interesting. I thought it had to be removeRPCs(), and this seems to remove it as well:

removeRPCs(networkView.viewid)

I believe your right… there is no RemoveRPC, only RemoveRPCs, and I believe you have to specify the first viewid of the networkView for it to work.

yes you probably need the “s” on the end of that. I didn’t actually test that specific code and typed that question from my phone on the train.

When I said “it works” I basically typed in what I had, but I let auto-complete fix that typo I made.

The point however is that being able to remove the RPC calls related to one specific NetworkView does allow me to get back to using good ole’ Network.Intantiate() and Network.Destroy().

Glory to the Unity gods. I will be sacrifices some peasants later today.

Yeah, its good stuff (and about time!)

I think its the first NetworkView not the first NetworkViewID of the NetworkView since there is only one NetworkViewID per NetworkView. (I believe :face_with_spiral_eyes: ) Actually that is probably what you meant but since you actually pass viewID what you said makes sense. N/M

I’m curious though if GameObject.networkView gives the first NetworkView if there are multiple ones. WIll it be safe to always remove the RPC from that before deleting or should I just go ahead and use the [0] version?

I would like to do some corrections though I use Unity for PC IDK about IPhone games really lol here is what I have and it works.

Network.RemoveRPCs(GetComponent(NetworkView).viewID);
	Network.Destroy(GetComponent(NetworkView).viewID);