I need to implement custom network visibility code in my game for a few reasons:
enabling/disabling objects instead of spawning and destroying when network visibility changes
send updated data about the object to a player when they begin observing it
I can’t use the built-in SyncVar or OnSerialize functions, as it does not fit my needs. Ideally, I’d like to send the data along with the packet which re-enables the object on the client.
So far, I created my own Network Proximity Checker, but I cannot find the place where I can override the messages sent. According to the docs, an ObjectHide message is sent to destroy a no longer visible network object, and ObjectSpawn is sent to create it again. Where can I override this behavior and instead of sending ObjectSpawn, send a custom message? I couldn’t find this information on Google or the docs.