My fire1 code does not work

I have tryed to fix this for long time but it does not work and i don’t get any errors, if you need the hole script just tell me.

void Update ()
{
if (Input.GetButtonDown(“Fire1”))
{
Shoot();
}

This could mean absolutely anything. The “code” here is so minimal it doesn’t show anything either. You need to provide some information if you want help.

So you’ve been debugging it right? What were you expecting to happen, what does/doesn’t happen and what were the results of debugging? The basics you should’ve figured out are things like, is the “Update” method being called, is the “Shoot” method being called etc.

here is the hole code

using UnityEngine;
using UnityEngine.Networking;
public class PlayerShoot : NetworkBehaviour {
private const string PLAYER_TAG = “Player”;
public PlayerWeapon weapon;
[SerializeField]
private Camera cam;
[SerializeField]
private LayerMask mask;
void Start ()
{
if (cam == null)
{
Debug.LogError(“PlayerShoot: No camera referenced!”);
this.enabled = false;
}
}
void Update ()
{
if (Input.GetButtonDown(“Fire1”))
{
Shoot();
}
}
[Client]
void Shoot ()
{
RaycastHit _hit;
if (Physics.Raycast(cam.transform.position, cam.transform.forward, out _hit, weapon.range, mask) )
{
if (_hit.collider.tag == PLAYER_TAG)
{
CmdPlayerShot(_hit.collider.name, weapon.damage);
}
}
}
[Command]
void CmdPlayerShot (string _playerID, int _damage)
{
Debug.Log(_playerID + " has been shot.");

Player _player = GameManager.GetPlayer(_playerID);
_player.RpcTakeDamage(_damage);
}

}

Posting the whole code doesn’t take any effort and doesn’t describe what “doesn’t work” and what debugging you’ve done or not done. Also, please use code-tags .

This above is essentially known as a lazy post, sorry to say.

i fixed it, forgot a tag on the player so there was no problem with the code