- Home /
Can OnSerializeNetworkView Call in the client by Writing mode?
In the server, OnSerializeNetworkView() run very well, the state changing can notify to all client. But, in the client, this is never called with isWriting set to true.
Can the client send data to server by OnSerializeNetworkView()?
Can anyone tell me why?
I figured out what problem it is.
The focus is the NetworkView's owner. In the Editor, the default NetworkView's viewId is zero, the server's default NetworkPlayer's Id. So NetworkViews created in the Editor act as server's NetworkViews by default.
If you want to send data to server from client. The first, you should call Network.AllocateViewID(). The second, you should call a RPC with the parameter NetworkViewID created at the first step, in the RPC function you can create the special NetworkView Component with the special NetworkViewID.
hi penny, I am facing a similar problem..can you help me out with some code..I am new to unity, so I didnt understand the steps completely