Hi, I’m new in the community. I do have a newbie question about OnSerializeNetworkView, I’ve been searching for an answer but i couldn’t find so I’m posting here.
Problem:
I’m making an authoritative server for the clients to connect in and I have a script for the player syncing by OnSerializeNetworkView method. On that script I do sync all player stats like hp, exp, damage… the problem is that it syncs all players data to all clients. What I mean is that I do not need to sync exp from all players to a specific client, I just need to sync his own exp. I mean client A doesn’t need to receive exp from the other players but his own. I hope I made it clear. Can anyone help? Thanks.
Thank you for replying Pulov. I was thinking about making it via RPC calls, but I have read that RPC should be used on not constant events, and since exp would be updated often I was thinking it should be made by OnSerializeNetwork. Is that wrong? Any help is appreciated.
Onserializeview updates 10 times per sec by default. Consider yourself what is the most suitable path. i would user an rpc for things such as fire gun. Death. Health etc
OK Thank you, I’m watching it right now, i just don’t think it fits much for what I’m trying to do. I wish there was a OnSerializeNetworkView solution for that.
I agree with Pulov, sending an RPC call to the server (or master client, however you’re managing it) to update this information should be more efficient and make sure that the network doesn’t have any unnecessary data being sent back and forth and to clients that don’t need it.
Yeah, even if my skills are low at programming and networking I’m trying to think ways I could save data transmission. It just look like implementing OnSerializeNetworkView its a easier approach to keep all data updated. Is it not efficient to send like player status data through OnSerializeNetworkView ? I’m using SetScope to stop transmitting the data from far away player also.