UNet: change texture on game object for local player only

I’m working on a multiplayer 3D basketball game. Players can catch the ball at which point it is added as a child to the players transform. So he’s basically holding it in front of him. This works fine on all clients, since the ball has a NetworkIdentity attached to it.

But now i want to change the render material ONLY for the player holding the ball to make the ball transparent since he needs to see through the where he’s aiming at. For all other players, of course, the material shouldn’t change.

I took different approaches but could at best get the right behavior only for the hosting player.

[SyncVar] uint ballObjNetID;

    public void EquipBall()
    {
        if (hasBall())
            return;

        CmdEquipBall(Camera.main.transform.forward);

        if (isLocalPlayer)
            ClientScene.FindLocalObject(new NetworkInstanceId(ballObjNetID)).GetComponent<Renderer>().material = transparentMaterial;

        bEquippedBall = true;
    }

    [Command]
    void CmdEquipBall(Vector3 cameraVec)
    {
        GameObject objBall = Instantiate(MPGameController.getPseudoBallPrefab(), transform.position + cameraVec * 25f, transform.rotation);
   
        objBall.transform.SetParent(GetComponentInChildren<Camera>().transform);

        NetworkServer.Spawn(objBall);

        ballObjNetID = objBall.GetComponent<NetworkIdentity>().netId.Value;

        RpcEquipBall(objBall, GetComponent<NetworkIdentity>().netId);
    }

    [ClientRpc]
    void RpcEquipBall(GameObject obj, NetworkInstanceId id)
    {obj.transform.SetParent(ClientScene.FindLocalObject(id).GetComponentInChildren<Camera>().transform);
    }

Solved it!!

I had to move the lines

         if (isLocalPlayer)
             ClientScene.FindLocalObject(new NetworkInstanceId(ballObjNetID)).GetComponent<Renderer>().material = transparentMaterial;

from EquipBall() to RpcEquipBall()