Shooting with Gun

Hello, I have a big problem on my FPS :

When I use Mouse0, a bullet appear and have a velocity, but I would like create damages to ennemi when the bullet is trigger with it.

I do this but I got damages and the other player not.

Thanks, Excuse me for my bad English.

(The game is Multiplayer).

Seems to be a problem with your own collider.

Look for ‘Layer Collision Matrix’ in Edit → Project Settings → Physiks.
Make sure, your bullet ignores your own player collider by using different layers.

Ok. Didn’t find any Ignore statements inside. Added this one for you.
Just know if gun has the collider and the gun is where the script is attached it will ignore collision with the gun. Might need to add the parent in too.

public IEnumerator OneShot ()
	canShoot = false;
	gun.bulletsInAmmo --;
	float x, y;

	if (!GetComponent<Crosshair>().isScope)
	x = Random.Range(-(100-(float)GetComponent<Crosshair>().tirAuJugee)/5000, (100-(float)GetComponent<Crosshair>().tirAuJugee)/5000);
	x = Random.Range(-(100-(float)gun.accuracy)/10000, (100-(float)GetComponent<Crosshair>().tirAuJugee)/10000);
	if (!GetComponent<Crosshair>().isScope)
		y = Random.Range(-(100-(float)GetComponent<Crosshair>().tirAuJugee)/5000, (100-(float)GetComponent<Crosshair>().tirAuJugee)/5000);
		y = Random.Range(-(100-(float)gun.accuracy)/10000, (100-(float)GetComponent<Crosshair>().tirAuJugee)/10000);	

	Rigidbody instantiatedProjectile = Network.Instantiate(projectile, transform.position + new Vector3(0, 0, 0), transform.rotation, 0) as Rigidbody;
	instantiatedProjectile.velocity = GetComponent<Transform>().TransformDirection((Vector3.forward + new Vector3(x, y, 0)) * gun.velocity + new Vector3(0, 0, 0));
	Physics.IgnoreCollision(instantiatedProjectile.GetComponent.<Collider>(), GetComponent.<Collider>());

	GetComponent<RotateX> ().rotationX = Mathf.Lerp (GetComponent<RotateX> ().rotationX, GetComponent<RotateX> ().rotationX - 0.6f, 1f);
	yield return new WaitForSeconds (gun.rateOfFire);
	canShoot = true;