So I have an object with a network ID and it contains a bunch of children that make up the mesh of the object. What I am trying to do is change the material of the child object that is selected over the server to all clients. However, whenever I try to pass the child object through a client rpc as a parameter I get a warning that says I need a network ID on it. Then when it tries to execute the code under the rpc the child object reference is null. However I specifically check if it is null before sending it to the rpc. I’ll leave the code block below. What am I doing wrong here? Is there a way to go about this differently?
[Command]
void CmdHighlight()
{
//get what the user hit and then if we hit something send it over the server to be highlighted
GameObject hitObject = ControllerUNET.CheckForHitObject();
if(hitObject != null)
RpcHighlight(hitObject);
}
[ClientRpc]
void RpcHighlight(GameObject hitObject)
{
//highlight the object over the server
ControllerUNET.HighlightHitObject(hitObject);
}