Raycast is not working, oncliking on the one player, the rest of the players also firing bullets, and collision not working too

My player manager file is this ***********

public class PlayerManager : MonoBehaviour
{

private IndividualPlayerHandler mPHandler;

public GameObject _Player;

// public GameObject _arrRefer;

public const int maxHealth = 100;
public int currentHealth = maxHealth;
public RectTransform healthBar;
//  private bool destroyOnDeath;

private Vector3[] currPlayerHandler = { new Vector3(-3f, 0.85f, -4f), new Vector3(-3f,0.85f, -1f), new Vector3(-3f, 0.85f, 2f)};

public void Start()
{
    mPHandler = GameObject.Find("Player").GetComponent<IndividualPlayerHandler>();
    for (int i = 0; i<currPlayerHandler.Length; i++)
   {
        Instantiate(_Player, currPlayerHandler*, transform.rotation);*

Debug.Log(“Player checking here” + _Player);
}
}
//List _arrIndividualPlayer = new List();
//private IndividualPlayerHandler mcurrActiveIndividual = null;
//public void OnSelectedPlayer()
//{
// for(int i=0; i<_arrIndividualPlayer.Count; i++)
// {
// mcurrActiveIndividual = ((GameObject)Instantiate(_Player)).GetComponent();
//}
//}
public void Update()
{
OnMouseDown();
}
public void OnMouseDown()
{
if (Input.GetMouseButtonDown(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit))
{
Transform objectHit = hit.transform;
mPHandler.PlayerBulletFire();
Debug.Log(“ColliderName” + hit.collider.name);
}
}
}

private void OnBulletCollision(int amount)
{
currentHealth -= amount;
if (currentHealth <= 0 || currentHealth >= 4)
{
currentHealth = 0;
Debug.Log(“Dead!”);
}
}

}
INDIVIDUAL PLAYER MANAGER *******************
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class IndividualPlayerHandler : MonoBehaviour {
// public PlayerManager pBullet;
public GameObject bulletPrefab;
public Transform BulletSpawn;
public Transform BulletSpawn1;
public Transform BulletSpawn2;
public Vector3[] BulletSpawningPoints = { new Vector3(-2.85f, 0.85f, -4f), new Vector3(-2.85f, 0.85f, -1f), new Vector3(-2.85f, 0.85f, 2f) };
public void PlayerBulletFire()
{
var bullet = Instantiate(bulletPrefab, BulletSpawn.transform.position, BulletSpawn.transform.rotation);
var bullet1 = Instantiate(bulletPrefab, BulletSpawn1.transform.position, BulletSpawn1.transform.rotation);
//var bullet2 = Instantiate(bulletPrefab, BulletSpawn2.transform.position, BulletSpawn2.transform.rotation);
// Add velocity to the bullet
bullet.GetComponent().velocity = bullet.transform.forward * 6;
bullet1.GetComponent().velocity = bullet.transform.forward * 6;
// bullet2.GetComponent().velocity = bullet.transform.forward * 6;
}
// public void PlayerBulletFire()
// {
// //for (int i = 0; i<BulletSpawningPoints.Length; i++)
// {
// var bullet = (Instantiate(bulletPrefab, BulletSpawn.transform.position, BulletSpawn.transform.rotation));
// bullet.GetComponent().velocity = bullet.transform.forward * 6;
// var bullet1 = Instantiate(bulletPrefab, BulletSpawn1.transform.position, BulletSpawn1.transform.rotation);
// bullet1.GetComponent().velocity = bullet1.transform.forward * 6;
// }
// }
// //if (gameObject.tag == “BulletSpawn1”)
// //{
// //}
// }
// // var bullet2 = Instantiate(bulletPrefab, BulletSpawn2.transform.position, BulletSpawn2.transform.rotation);
// //// Add velocity to the bullet
// //bullet2.GetComponent().velocity = bullet2.transform.forward * 6;
//}
}
,

Not sure about your issue with all of the players firing, but with your collision detection, have you made sure that both GameObjects have colliders and at least one of them has a rigidbody? Otherwise they won’t detect the collision.