[C#] Raycast and raycasthit, destroy and instantiate gameobjects

Hello,
i’d like to have a raycast that, when hits something, destroys it and instantiate an explosion prefab.
here’s my code

Vector3 fwr = transform.TransformDirection (Vector3.forward);
		if (IsReadyToShoot == true && WantsToShoot == true) {
			WantsToShoot = false;
			Laser.SetActive (true);
			ASS.Play();
			Invoke ("Unloader", 0.1f);
			ReloadTime = 10f;
			if ((Physics.Raycast (Ray0.transform.position, fwr, 20f, Enemies)) || (Physics.Raycast (Ray1.transform.position, fwr, 20f, Enemies)) || (Physics.Raycast (Ray2.transform.position, fwr, 20f, Enemies)) || (Physics.Raycast (Ray3.transform.position, fwr, 20f, Enemies)) || (Physics.Raycast (Ray4.transform.position, fwr, 20f, Enemies)) || (Physics.Raycast (Ray5.transform.position, fwr, 20f, Enemies))) {
				Debug.Log ("Hit!");

			}

as you can see i got 6 gameobject from which i cast 6 rays. i’d like to make a script that destroys every hit object that is hit from at least one ray, and to instantiata an explosion in the coordinates of the hit.
i was trying to use raycasthit but even if i looked on the internet for long, i can’t figure out how to make it work.
thanks in advance

Use the version of Physics.Raycast that takes an “out RaycastHit hit” parameter.
You’ll also want to check each ray individually, so you’ll be able to destroy more than just one object.

    RaycastHit hit;
    if (IsReadyToShoot && WantsToShoot ) {
        WantsToShoot = false;
        Laser.SetActive (true);
        ASS.Play();
        Invoke ("Unloader", 0.1f);
        ReloadTime = 10f;
        if ((Physics.Raycast (Ray0.transform.position, transform.forward, out hit, 20f, Enemies)) {
            Destroy(hit.gameObject);
        }
        if ((Physics.Raycast (Ray1.transform.position, transform.forward, out hit, 20f, Enemies)) {
            Destroy(hit.gameObject);
        }
        if ((Physics.Raycast (Ray2.transform.position, transform.forward, out hit, 20f, Enemies)) {
            Destroy(hit.gameObject);
        }
        if ((Physics.Raycast (Ray3.transform.position, transform.forward, out hit, 20f, Enemies)) {
            Destroy(hit.gameObject);
        }
        if ((Physics.Raycast (Ray4.transform.position, transform.forward, out hit, 20f, Enemies)) {
            Destroy(hit.gameObject);
        }
        if ((Physics.Raycast (Ray5.transform.position, transform.forward, out hit, 20f, Enemies)) {
            Destroy(hit.gameObject);
        }

Also:
You can use transform.forward to get an object’s forward vector, instead of trying to transform the world forward vector.
You don’t need to check “== true” for boolean values, you can just check the value

Hopefully this is enough to get you started?