How do I make a Game Object invisible?

Hi, I’m working on a multiplayer project and I want to make it so you can’t see certain objects such as your player model but you can see others. I can’t do different layers because then all players will only see whats suppose to be seen in first person. How would I go about doing this? Thanks!

Another way to say what I mean is I’m using the layer trick to make the guns not clip through the walls. How can I make it so I can’t see the other players gun through the wall.
I tried this but It didn’t work
public class PlayerSetup : NetworkBehaviour
{
[SerializeField]
Behaviour componentsToDisable;
GameObject gunl;
GameObject mp;
void Start ()
{

		if (!isLocalPlayer)
		{
			gunl = GameObject.FindGameObjectsWithTag("gun"); 
			mp = GameObject.FindGameObjectsWithTag("mp");
			for (int i = 0; i < componentsToDisable.Length; i++)
			{
				componentsToDisable*.enabled = false;*
  •  	}*
    
  •  	for (int a = 0; a <= gunl.Length; a++)*
    
  •  	{*
    
  •  			gunl[a].layer = 0;*
    
  •  	}*
    
  •  	for (int c = 0; c <= mp.Length; c++)*
    
  •  	{*
    
  •  		mp*
    

```c
*.layer = 0;

			}
		}
	}
}*

```

I found out the answer before the question got approved (like a week) sorry about that… Here’s what I came up with probably works better with a loop or something but it works for me,
using UnityEngine;
using System.Collections;
using UnityEngine.Networking;

public class PlayerSetup : NetworkBehaviour
{
	[SerializeField]
	Behaviour[] componentsToDisable;
	public GameObject thief;
	public GameObject gun;
	public GameObject body;
	public GameObject bottoms;
	public GameObject eyes;
	public GameObject gloves;
	public GameObject mask;
	public GameObject shoes;
	public GameObject tops;
	public GameObject mag;
	public GameObject sights;
	public GameObject bodyA;
	void Start ()
	{

		if (!isLocalPlayer)
		{
			for (int i = 0; i < componentsToDisable.Length; i++)
			{
				componentsToDisable*.enabled = false;*
  •  	}*
    
  •  }*
    
  •  if (isLocalPlayer)*
    
  •  {*
    
  •  	body.layer = 28;*
    
  •  	bottoms.layer = 28;*
    
  •  	eyes.layer = 28;*
    
  •  	gloves.layer = 28;*
    
  •  	mask.layer = 28;*
    
  •  	shoes.layer = 28;*
    
  •  	tops.layer = 28;*
    
  •  	thief.layer = 28;*
    
  •  	gun.layer = 30;*
    
  •  	mag.layer = 30;*
    
  •  	sights.layer = 30;*
    
  •  	bodyA.layer = 30;*
    
  •  }*
    
  • }*
    }