Highlight other players - Networking

So my networking is going well so far except for one thing. I have two scripts that worked on other objects when the game wasn’t built for networking, but they no longer function properly and behave oddly.

The effect of the first script is to highlight objects blue when your cursor goes over them.

The effect of the second script is that if you left mouse click on the target, it stays highlighted blue (except if it’s yourself).

When I build and play a network game, they function fine for highlighting my own player, however, when I put my mouse over another player, it turns them black and they just stay that way even if the cursor goes off of them.

I can still click on the enemies and it targets them and I can shoot at them, the odd thing is that they turn black when the script should be highlighting their original color to a blue. Both scripts are attached to the player object.

I want the other players to be highlighted blue for just the player doing the on mouse over and the targeting.

HighlightScript (first script)

private float blueMultiply = 3.50f;

    private float redGreenMultiply = 0.50f; 

 

    private Color originalColor;

 

    private void Start()

    {
		if(networkView.isMine == true )
		{

        originalColor = gameObject.renderer.material.color;
			
		}
		else
		{
			enabled = false;
		}
		

    }

 

    void OnMouseEnter()

    {

        AddHighlight();

    }

 

    void OnMouseExit()

    {

        RemoveHighlight();

    }

 

    private void  AddHighlight() 

    {

        float red = originalColor.r * redGreenMultiply;

        float blue = originalColor.b * blueMultiply;

        float green = originalColor.g * redGreenMultiply;

 

        gameObject.renderer.material.color = new Color(red, green, blue);

    }

 

    private void RemoveHighlight()

    {

        gameObject.renderer.material.color = originalColor;

    }

Targeting Script:

    			//targeting
    			if (Input.GetMouseButtonDown(0))
    			{
    				ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    				if (Physics.Raycast (ray, out hit, Mathf.Infinity)){
    					if (hit.transform.tag == "Player"){
    						if (hasTarget)
    						{
    							RemoveHighlightOnTarget();
    						}
    						if (hit.transform.gameObject != gameObject)
    						{
    							go = hit.transform.gameObject;
    							target = go.transform;
    							hasTarget = true;
    							originalColor = go.renderer.material.color;
    							AddHighlightOnTarget();
    						}
    						//Debug.Log (go.renderer.material.color);
    					}
    				}
    			}  
    			if (go == null)
    			{
    				hasTarget = false;
    			}

Any insight on this would be greatly appreciated! Thanks

If the remote computer network instantiates their player, then the if on line 27 is never entered on your computer, and a possibly null Color is used.